• 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

Updating values in a jTable

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Here's the situation.
We're doing a hotel booking system for a school project and we need to retrieve a list of available rooms for a give period of time.
Rooms, bookings and so on are retrieved from a database, and the logic for that seems to be working, only the jTable that is supposed to display the values doesn't update.

I hope you guys can help.

Here's the code for the panel that contains the table:


 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Without the code of MyModel I doubt we can say anything useful. I see no updates made to the table / model in the code you posted.
 
Tore Julø
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Isn't it ok to embed it in the jPanel?
This is on line 166 in the code I pasted :



It's calling mappingArray, which is located in a class with the somewhat awkward name of BookingRoomController.



And it does seem to work, because when jPanel instantiates the table looks as expected. What remains now is figuring out how to update the actual table, because I'm fairly certain that we're getting the correct data when pressing the ok-button (see line 136).
I've read about fireTableDataChanged and newDataAvailable, but I'm not sure where and how to implement them.
 
reply
    Bookmark Topic Watch Topic
  • New Topic