This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: JTree and JScrollPane