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.
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.