Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to toggle components to a dialog

Status
Not open for further replies.

VenkatRastapuram

Programmer
Oct 24, 2003
46
IN
Hi ,

I have created a OptionPane in which there are two panels(containg say a component) top and bottom and one button 'show/Hide'. By default I should show a top panel and a button but when I click on the 'show/Hide' button it should show the top panel along with bottom panel and when I click the button again it should show only top panel with button.

Pls help me in this regard.

Thank U.
Regards
R.Venkatesh
Ocimum Biosolutions
 
Some guidelines:

- Add action listener to the button (see ActionListener interface)
- In the actionPerformed method, use the setVisible(false) method of the second panel if it's showing (isVisible() method) and the setVisible(true) if not.

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top