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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Really simple window closing problem.

Status
Not open for further replies.

andypara

Programmer
Apr 25, 2002
32
0
0
GB
All I want to do is create a JFrame with one JButton. This I can do. When the button is pressed I want another JFrame to open. This I can also do. However, when the new window opens I want the old window to dissapear. I'm having real trouble with this and I would appreciate it if some one could give me two example classes to do this.

Please send to andrew.smith@vosperthornycroft.com

and copy in ajs@bliss27.freeserve.co.uk

I know this is a stupid problem. So far I have been using the "public static void main method" of the first class to pack and setVisble the first window. This works fine. I'm then trying to use a nested buttonhandler class to insantiate the next class, pack the frame, setVisible, but when I use this nested class to setVisible(false) the first window it doesn't compile, saying :-

M:\java\JAVASW~1\LunarPhases.java:146: cannot resolve symbol
symbol : variable lunarPhasesFrame
location: class LunarPhases.ButtonHandler
lunarPhasesFrame.isVisible(false);

I'd be happy to send both classes to anyone who wants them.

Many thanks.
 
do
oldFrame.dispose() Ion Filipski
1c.bmp


filipski@excite.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top