• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTable doesn't show new model after adding new row

 
Greenhorn
Posts: 5
Android Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic