[Rescue-svn] SF.net SVN: rescue:[36] Rescue/src/rescue/gui/RescueGUI.java
Status: Beta
Brought to you by:
yuranet
From: <yu...@us...> - 2013-09-12 20:49:52
|
Revision: 36 http://sourceforge.net/p/rescue/code/36 Author: yuranet Date: 2013-09-12 20:49:49 +0000 (Thu, 12 Sep 2013) Log Message: ----------- correct frame shown and hidden Modified Paths: -------------- Rescue/src/rescue/gui/RescueGUI.java Modified: Rescue/src/rescue/gui/RescueGUI.java =================================================================== --- Rescue/src/rescue/gui/RescueGUI.java 2013-09-12 20:33:04 UTC (rev 35) +++ Rescue/src/rescue/gui/RescueGUI.java 2013-09-12 20:49:49 UTC (rev 36) @@ -264,7 +264,7 @@ } // does not work at the beggining of the game - setVisible(false); + findParentFrame(this).setVisible(false); } else { @@ -305,7 +305,7 @@ } - setVisible(true); + findParentFrame(this).setVisible(true); } else { @@ -346,13 +346,14 @@ } catch (InterruptedException e) {} - Frame frame = findParentFrame(this); + Frame frame; if ( rescue.getMode() ) { - frame = (Frame)Windows.elementAt(0); - } + else { + frame = findParentFrame(this); + } JOptionPane.showMessageDialog(frame, "You are dead!" , "Dead", JOptionPane.PLAIN_MESSAGE ); @@ -993,10 +994,7 @@ } } - public static Frame findParentFrame(Container c) { - return (Frame)javax.swing.SwingUtilities.getAncestorOfClass(Frame.class, c); - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |