• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Updating values in a jTable

 
Tore Julø
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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:


 
Rob Spoor
Sheriff
Pie
Posts: 20611
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic