This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one 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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTree and JScrollPane" Watch "JTree and JScrollPane" New topic
Author

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:

Settings
Server
Client

Environment
Server
Client

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