Meaningless Drivel is fun!
The moose likes Swing / AWT / SWT and the fly likes JTree and JScrollPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTree and JScrollPane" Watch "JTree and JScrollPane" New topic

JTree and JScrollPane

Shalini Chandel
Ranch Hand

Joined: May 05, 2005
Posts: 115
Hi all,

I am using JScrollPane as Horizontal Split. I used JTree in Left pane. I have 2 JApplet files with Swing components on it (Forms to take user input)

JTree has structure as follows:



When I click SERVER, i want to display my server applet in right pane.
I wrote code as follows for event handling:

pa is a Panel i added to right pane and InstallDemo and CompanyInfoo are 2 applet classes.

It displaying the node selected but its not displaying the applet.
Please help...

SCJP 1.4
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535

Also, you might try checking the preferred size of the incoming component. If it was designed to be placed in an expanding–type layout, such as the Center section of a BorderLayout, you may need to use a different layout manager and/or provide size hints.
I agree. Here's the link:
subject: JTree and JScrollPane
jQuery in Action, 3rd edition