Re: Loading Jpanels according to selection
On 7/28/2010 1:48 PM, tamasu wrote:
I have JcomboBox on a main Jpanel. I need to display different
controls according the selection the user makes from the JComboBox.
To facilitate the design process and to use the netbeans GUI to align
controls on the main Jpanel I would like to create the Jpanels
separately as different classes.
Can you assist on how I could load the respective Jpanels according to
the user selection or can you highlight how such a process is normally
handled, that is, how one can change the controls that are to be
displayed according to the user selection but all should be displayed
in the same location and position as the other Jpanels. For example if
a user select option A from JComboBox Panel A with a number of
controls is display, likewise if Option D is selected Panel D with a
number of controls is displayed at the same location and position as
the other JPanels including the Panel A as per this example.
Please do not hesitate to contact me if you need further
clarifications.
Thanks and regards
Take a look at CardLayout, it might help do what you're trying to do.
--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>