0

I have designed a form using JGoodies. In my From I have a Jtable.

FormLayout layout = new FormLayout(…) ;  
CellConstraints cc = new CellConstraints() ;  

PanelBuilder builder = new PanelBuilder(layout);  

String[] columnNames = {"name","code"};  
Object[][] data = null ;  

DefaultTableModel tmodel = new DefaultTableModel(data, columnNames);  

JTable table = new JTable(tmodel);  
JScrollPane scrollPane = new JScrollPane(table);  

builder.add(scrollPane, cc.xyw (2, 6, 9));  

this.add(builder.getPanel()) ;  

When the table's content changes, I have to refresh the screen to show the new table. How can I do this?

parviin57
  • 106
  • 5
  • Ch age the tables model. This would require you to maintain the JTable as a instance variable – MadProgrammer Jul 11 '14 at 09:27
  • You simply need to update your table model. In this case your table will be refreshed automatically. – Sergiy Medvynskyy Jul 11 '14 at 09:27
  • The JTable and updating its model has nothing to do with the JGoodies Form API. Your question is just about updating a table. The data instance is null, instead try populating the data with some strings. Show the table, then change the data and fire an update event described [here](http://docs.oracle.com/javase/tutorial/uiswing/components/table.html#fire). – javajon Jul 12 '14 at 05:08

0 Answers0