Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable problem using the same reference

 
Andras Nemeth
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
In my GUI, I want to use the same JTable at the "search" and the "book" panels... (I use JTabbedPane and put these JPanels on it)
So, I made a mediator class which instantiate the JTable with my own TableModel.
In both (search and book) pane I ask the reference of JTable from the Mediator class when display the pane.
Problem: only one pane can show this JTable! The last one which asked for the reference.
Is there anything what I missed?
I can paste a short code here if it is needed for make it clearer.
I look forward to reading your answer.
Thanks a lot.
Br,
Ban
 
Andras Nemeth
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Meanwhile, I got light! I can not add one
reference of JComponent to two panel.
The add method will remove the previous one!
I managed to solve the problem with common
TableModel and ListSelectionModel, but two
JTable instance.
Br,
Ban
PS: I also close the thread in absence of interest. :P
 
Andras Nemeth
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
At least, I thought I close the topic, but...
I am so little grain of dust here, that I am not allowed to do that. So, bartenders and other demigods , please, do it.
Cheers,
Ban
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!