Hi everybody,
I have a Jtable and i am going to add an empty row after pressing a button named insert.
Whenever i put these following code in my class ,it works properly.
I should add after these 2 lines i create a JScrollPane and add it to the getContentPane().
model = new DefaultTableModel(data,columnNames);
model.insertRow(table.getRowCount(),new Object[] {"","","","",""});
THE PROBLEM:
Whenever i put these 2 lines in a seperate function like addRow() and call this function after pressing the insert button , i see no changes in Jtable,i mean a new empty row isn't added to the table.
I think i should add a new table to the JScrollPane but since i'm a new programmer in java ,i don't know how to do this.
Can anyone help me please?