aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Problems with GUI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Problems with GUI" Watch "Problems with GUI" New topic
Author

Problems with GUI

Pervez Ahmed
Greenhorn

Joined: Jul 18, 2001
Posts: 19
Hi all,
I'm facing this problem with my Gui, please advise if anyone else has come across same issue. The first time I access my app, I select an origin and destination and correctly populate my JTable. I then perform another search and I see correct data in the JTable, but when I select a row, the table data changes back to the first request data. My Gui class implements just ActionListener and I am extending AbstractTableModel. Am I missing something here?
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937
Do you have a method equivalent to the one shown below in your table data model, and do you invoke it after you get new search results?

Eugene.
Manish Kumar
Ranch Hand

Joined: Apr 15, 2002
Posts: 53
Hi,
There is no need keep any reference after the second search where the old searched information can exists.
Are u creating multiple instances of your TableModel ?? and by mistake using the older instance of the tableModel to populate the Table..
I think that one of the best practice to populate the table is to create one instance of the table model.. set this model to the Flight table..
Also, Create a public method in your extended table model to update/change the data in the modal. As mentioned by Eugene.
Pervez Ahmed
Greenhorn

Joined: Jul 18, 2001
Posts: 19
Yes Eugene I do just that. Are you using a "Model Manager" class?
harcharan kanwal
Ranch Hand

Joined: Jul 02, 2001
Posts: 64
hi pervej,
i think you are adding the Jpanel into the contentPane of your JFrame,make sure you remove the old search reference of your Jpanel from the contentpane,before you add new search reference of JPanel to the contentpane of this JFrame.
hope this helps
harcharan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems with GUI
 
Similar Threads
jtable
JTable
jtable not refreshing
JTable
JTable