How to add data to JTable while working with netbeans. Netbeans in this reverse code is as follows:
jTable1 = new javax.swing.JTable(); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null}, {null, null}, {null, null}, {null, null} }, new String [] { "Name", "Branch" } ) { boolean[] canEdit = new boolean [] { false, false }; public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; } });
The 2-D object array and String array have local access, so I cannot use it when I want in the middle of the program. (in some function)

as in the above table, I will add a name and branch in some functions. But how can I do this?
Can someone tell me so that I can add data to JTable?
source share