Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2005

Tip: Looking for answers? Try searching our database.

JSplitPane with JTree/JTable 1 mouse click update problem

Thread view: 
Joost Kraaijeveld - 25 Jan 2005 07:30 GMT
I have a JSplitPane with a JTree on the left and a JTabbedPane on the
right. I want the JTabbedPane replaced, based on the actual type of the
object that is clcked.

That works OK but the following happens:

On the first time click on an object in the tree, the JTabbedPane
appears but only half filled. The second time I click (without changing
the object in the tree), the JTabbedPane appears fully filled.

Exactly the same code is executed:

if(e.getClickCount() == 1)
{
DefaultMutableTreeNode selectedObject =
(DefaultMutableTreeNode)selPath.getLastPathComponent();

if( selectedObject.getUserObject() instanceof RootNode)
{
  RootTabbedPane tabbedPane = new RootTabbedPane();
  splitPane.setRightComponent(tabedPane }
else if( selectedObject.getUserObject() instanceof IntermediateNode)
{
  IntermediateTabbedPane tabbedPane = new IntermediateTabbedPane();
  splitPane.setRightComponent(tabedPane }
}

Can anyone give me an idea on how to solve this problem?

TIA

Joost
Andrew Thompson - 25 Jan 2005 08:31 GMT
> Can anyone give me an idea on how to solve this problem?

- pack()/validate(), else..
- <http://www.physci.org/codes/sscce.jsp>

HTH

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.