Tuesday, April 23, 2002 07:51 PM
One area of my GUI needs to be able to change in
response to JButton presses. One button should
cause it to display an image and another button
should cause it to display some text and another
JButton. The area that needs to change is the top
of a JSplitPane. I tried having two other classes inherit from JPanel having the layouts I needed.
To help me explain, I'll call them imagePanel and infoPanel. I then made the top of the JSplitPane a JPanel and then in the event handling
code of the JButtons, I made this JPanel equal to
the needed panel(imagePanel or infoPanel):
topPanel = (JPanel)imagePanel;
What I'm not sure about is how to now make this
panel display in the GUI since the GUI is already
visible. This may be a stupid question however, I am
fairly new to Java. I appreciate any help.
Re: How to display two JPanels containing different components in the same space?
Wednesday, April 24, 2002 06:01 PM