Why does not showing the object?
here the example of textfile or database.txt:This my project. I would like to show the object using text file and store in JTable per row and line by line and split it to "-".
07-12345-Wilson-Dacles-T.-February 1, 1995-male-lordwils02@gmail.com-cuasay st. 21-1234-Wilson-Dacles-T.-February 1, 1995-male-lordwils02@gmail.com-cuasay st.
Then, here is the output of my JTable like that I said the object is does'nt show:
sasasasaaaaa.jpg
Sorry for my grammar.! I'm veteran for filipino language.. I hope you help me!!
try{ BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("Database.txt")))); String line = ""; int width = 0, height = 0; while((line = br.readLine())!=null){ if(width == 0){ String data[] = line.split("-"); width = data.length; } height++; String matrix[][] = new String[height][width]; model = new DefaultTableModel(matrix, col); table = new JTable(model){ public boolean isCellEditable(int row, int column){ return false; }}; } }catch (IOException ex){ ex.printStackTrace(); }