aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTable doesn't show new model after adding new row Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable doesn Watch "JTable doesn New topic
Author

JTable doesn't show new model after adding new row

Davide Aguiari
Greenhorn

Joined: Aug 28, 2012
Posts: 5

I can't repaint my jTable. I must re-run all application to show addRow.

This is the code:

MainPage.java http://pastebin.com/6FZL1pKC



These last 3 println() show that model has changed! lol{} Output:

Tratta AGGIUNTA

javax.swing.table.DefaultTableModel@1ca7e4a

BOLOGNA

...

CATANZARO

NEW_DEPARTURE_ADDED

javax.swing.table.DefaultTableModel@17d54dd

javax.swing.table.DefaultTableModel@17d54dd

So it works..but It doesn't show new model!!

AddTrip.java http://pastebin.com/t0LqF91a



MPTable.java http://pastebin.com/2gXvYNLC



I've tried to add tripModel.fireTableDataChanged() after MPTable.myModel() or jTable1.setModel or .repaint() [all in tripRepaint()] with no success.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable doesn't show new model after adding new row