Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable doesn't show new model after adding new row

 
Davide Aguiari
Greenhorn
Posts: 5
Android Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic