JSplitPane.

K

Kalpesh Modha

Hello.

I have a JSplitPane as below. Now currently the right handside is a html
area. What I want to do is make the right hand side load a JFrame or a
class. So depending on which branch/left the user selected on the left the
right class would be loaded on the right hand side.

Can I do that, if so how ?

JSplitPane sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,new
JScrollPane(tree),new JScrollPane(htmlArea));

Many thanks for you help.

Thanks
Kalpesh Modha
 
B

Babu Kalakrishnan

Kalpesh said:
Hello.

I have a JSplitPane as below. Now currently the right handside is a html
area. What I want to do is make the right hand side load a JFrame or a
class. So depending on which branch/left the user selected on the left the
right class would be loaded on the right hand side.

Can I do that, if so how ?

Your question ( at least one part of it) doesn't make too much sense.
How do you load a "class" into one pane of a JSplitPane ?? Do you mean a
JPanel or something like that ?

As for loading JFrames, I'm afraid it is not possible. The AWT subsystem
does not allow any Component descending from java.awt.Window to be added
to any other Container. So Windows, Frames and Dialogs must always be
only top level containers.

BK
 
K

Kalpesh Modha

Thanks.

Babu Kalakrishnan said:
Your question ( at least one part of it) doesn't make too much sense. How
do you load a "class" into one pane of a JSplitPane ?? Do you mean a
JPanel or something like that ?

As for loading JFrames, I'm afraid it is not possible. The AWT subsystem
does not allow any Component descending from java.awt.Window to be added
to any other Container. So Windows, Frames and Dialogs must always be only
top level containers.

BK
 
A

andreas

why do you need to load a JFrame anyway. just load the
jframe.getComponentPane()
into your JSplitPane. would make more sense...

andreas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top