aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Updating values in a jTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Updating values in a jTable" Watch "Updating values in a jTable" New topic
Author

Updating values in a jTable

Tore Julø
Greenhorn

Joined: Apr 01, 2009
Posts: 2
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

Joined: Oct 27, 2005
Posts: 19670
    
  18

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Tore Julø
Greenhorn

Joined: Apr 01, 2009
Posts: 2
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Updating values in a jTable