Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

JTable problem using the same reference

 
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
 
Now I am super curious what sports would be like if we allowed drugs and tiny ads.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic