There is no need to store parent frame locally.
This commit is contained in:
parent
d34457b8fe
commit
cdcd780e7a
@ -34,7 +34,6 @@ import javax.swing.JWindow;
|
|||||||
public class SplashScreen extends JWindow
|
public class SplashScreen extends JWindow
|
||||||
{
|
{
|
||||||
Image image;
|
Image image;
|
||||||
JFrame parentFrame;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param path of image file
|
* @param path of image file
|
||||||
@ -43,7 +42,6 @@ public class SplashScreen extends JWindow
|
|||||||
*/
|
*/
|
||||||
public SplashScreen(String path, long time, JFrame parent)
|
public SplashScreen(String path, long time, JFrame parent)
|
||||||
{
|
{
|
||||||
parentFrame = parent;
|
|
||||||
setBackground(new Color(0, 255, 0, 0)); // Transparency.
|
setBackground(new Color(0, 255, 0, 0)); // Transparency.
|
||||||
image = Toolkit.getDefaultToolkit().getImage(path);
|
image = Toolkit.getDefaultToolkit().getImage(path);
|
||||||
ImageIcon imageIcon = new ImageIcon(image);
|
ImageIcon imageIcon = new ImageIcon(image);
|
||||||
@ -58,14 +56,14 @@ public class SplashScreen extends JWindow
|
|||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
if (parentFrame != null)
|
if (parent != null)
|
||||||
{
|
{
|
||||||
// Make parent visible.
|
// Make parent visible.
|
||||||
parentFrame.setVisible(true);
|
parent.setVisible(true);
|
||||||
// Focus parent window.
|
// Focus parent window.
|
||||||
parentFrame.toFront();
|
parent.toFront();
|
||||||
parentFrame.setState(Frame.ICONIFIED);
|
parent.setState(Frame.ICONIFIED);
|
||||||
parentFrame.setState(Frame.NORMAL);
|
parent.setState(Frame.NORMAL);
|
||||||
}
|
}
|
||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,6 @@ import javax.swing.JWindow;
|
|||||||
public class SplashScreen extends JWindow
|
public class SplashScreen extends JWindow
|
||||||
{
|
{
|
||||||
Image image;
|
Image image;
|
||||||
JFrame parentFrame;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param path of image file
|
* @param path of image file
|
||||||
@ -43,7 +42,6 @@ public class SplashScreen extends JWindow
|
|||||||
*/
|
*/
|
||||||
public SplashScreen(String path, long time, JFrame parent)
|
public SplashScreen(String path, long time, JFrame parent)
|
||||||
{
|
{
|
||||||
parentFrame = parent;
|
|
||||||
setBackground(new Color(0, 255, 0, 0)); // Transparency.
|
setBackground(new Color(0, 255, 0, 0)); // Transparency.
|
||||||
image = Toolkit.getDefaultToolkit().getImage(path);
|
image = Toolkit.getDefaultToolkit().getImage(path);
|
||||||
ImageIcon imageIcon = new ImageIcon(image);
|
ImageIcon imageIcon = new ImageIcon(image);
|
||||||
@ -58,14 +56,14 @@ public class SplashScreen extends JWindow
|
|||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
if (parentFrame != null)
|
if (parent != null)
|
||||||
{
|
{
|
||||||
// Make parent visible.
|
// Make parent visible.
|
||||||
parentFrame.setVisible(true);
|
parent.setVisible(true);
|
||||||
// Focus parent window.
|
// Focus parent window.
|
||||||
parentFrame.toFront();
|
parent.toFront();
|
||||||
parentFrame.setState(Frame.ICONIFIED);
|
parent.setState(Frame.ICONIFIED);
|
||||||
parentFrame.setState(Frame.NORMAL);
|
parent.setState(Frame.NORMAL);
|
||||||
}
|
}
|
||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,6 @@ import javax.swing.JWindow;
|
|||||||
public class SplashScreen extends JWindow
|
public class SplashScreen extends JWindow
|
||||||
{
|
{
|
||||||
Image image;
|
Image image;
|
||||||
JFrame parentFrame;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param path of image file
|
* @param path of image file
|
||||||
@ -43,7 +42,6 @@ public class SplashScreen extends JWindow
|
|||||||
*/
|
*/
|
||||||
public SplashScreen(String path, long time, JFrame parent)
|
public SplashScreen(String path, long time, JFrame parent)
|
||||||
{
|
{
|
||||||
parentFrame = parent;
|
|
||||||
setBackground(new Color(0, 255, 0, 0)); // Transparency.
|
setBackground(new Color(0, 255, 0, 0)); // Transparency.
|
||||||
image = Toolkit.getDefaultToolkit().getImage(path);
|
image = Toolkit.getDefaultToolkit().getImage(path);
|
||||||
ImageIcon imageIcon = new ImageIcon(image);
|
ImageIcon imageIcon = new ImageIcon(image);
|
||||||
@ -58,14 +56,14 @@ public class SplashScreen extends JWindow
|
|||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
if (parentFrame != null)
|
if (parent != null)
|
||||||
{
|
{
|
||||||
// Make parent visible.
|
// Make parent visible.
|
||||||
parentFrame.setVisible(true);
|
parent.setVisible(true);
|
||||||
// Focus parent window.
|
// Focus parent window.
|
||||||
parentFrame.toFront();
|
parent.toFront();
|
||||||
parentFrame.setState(Frame.ICONIFIED);
|
parent.setState(Frame.ICONIFIED);
|
||||||
parentFrame.setState(Frame.NORMAL);
|
parent.setState(Frame.NORMAL);
|
||||||
}
|
}
|
||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,6 @@ import javax.swing.JWindow;
|
|||||||
public class SplashScreen extends JWindow
|
public class SplashScreen extends JWindow
|
||||||
{
|
{
|
||||||
Image image;
|
Image image;
|
||||||
JFrame parentFrame;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param path of image file
|
* @param path of image file
|
||||||
@ -43,7 +42,6 @@ public class SplashScreen extends JWindow
|
|||||||
*/
|
*/
|
||||||
public SplashScreen(String path, long time, JFrame parent)
|
public SplashScreen(String path, long time, JFrame parent)
|
||||||
{
|
{
|
||||||
parentFrame = parent;
|
|
||||||
setBackground(new Color(0, 255, 0, 0)); // Transparency.
|
setBackground(new Color(0, 255, 0, 0)); // Transparency.
|
||||||
image = Toolkit.getDefaultToolkit().getImage(path);
|
image = Toolkit.getDefaultToolkit().getImage(path);
|
||||||
ImageIcon imageIcon = new ImageIcon(image);
|
ImageIcon imageIcon = new ImageIcon(image);
|
||||||
@ -58,14 +56,14 @@ public class SplashScreen extends JWindow
|
|||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
if (parentFrame != null)
|
if (parent != null)
|
||||||
{
|
{
|
||||||
// Make parent visible.
|
// Make parent visible.
|
||||||
parentFrame.setVisible(true);
|
parent.setVisible(true);
|
||||||
// Focus parent window.
|
// Focus parent window.
|
||||||
parentFrame.toFront();
|
parent.toFront();
|
||||||
parentFrame.setState(Frame.ICONIFIED);
|
parent.setState(Frame.ICONIFIED);
|
||||||
parentFrame.setState(Frame.NORMAL);
|
parent.setState(Frame.NORMAL);
|
||||||
}
|
}
|
||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,6 @@ import javax.swing.JWindow;
|
|||||||
public class SplashScreen extends JWindow
|
public class SplashScreen extends JWindow
|
||||||
{
|
{
|
||||||
Image image;
|
Image image;
|
||||||
JFrame parentFrame;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param path of image file
|
* @param path of image file
|
||||||
@ -43,7 +42,6 @@ public class SplashScreen extends JWindow
|
|||||||
*/
|
*/
|
||||||
public SplashScreen(String path, long time, JFrame parent)
|
public SplashScreen(String path, long time, JFrame parent)
|
||||||
{
|
{
|
||||||
parentFrame = parent;
|
|
||||||
setBackground(new Color(0, 255, 0, 0)); // Transparency.
|
setBackground(new Color(0, 255, 0, 0)); // Transparency.
|
||||||
image = Toolkit.getDefaultToolkit().getImage(path);
|
image = Toolkit.getDefaultToolkit().getImage(path);
|
||||||
ImageIcon imageIcon = new ImageIcon(image);
|
ImageIcon imageIcon = new ImageIcon(image);
|
||||||
@ -58,14 +56,14 @@ public class SplashScreen extends JWindow
|
|||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
if (parentFrame != null)
|
if (parent != null)
|
||||||
{
|
{
|
||||||
// Make parent visible.
|
// Make parent visible.
|
||||||
parentFrame.setVisible(true);
|
parent.setVisible(true);
|
||||||
// Focus parent window.
|
// Focus parent window.
|
||||||
parentFrame.toFront();
|
parent.toFront();
|
||||||
parentFrame.setState(Frame.ICONIFIED);
|
parent.setState(Frame.ICONIFIED);
|
||||||
parentFrame.setState(Frame.NORMAL);
|
parent.setState(Frame.NORMAL);
|
||||||
}
|
}
|
||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,6 @@ import javax.swing.JWindow;
|
|||||||
public class SplashScreen extends JWindow
|
public class SplashScreen extends JWindow
|
||||||
{
|
{
|
||||||
Image image;
|
Image image;
|
||||||
JFrame parentFrame;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param path of image file
|
* @param path of image file
|
||||||
@ -43,7 +42,6 @@ public class SplashScreen extends JWindow
|
|||||||
*/
|
*/
|
||||||
public SplashScreen(String path, long time, JFrame parent)
|
public SplashScreen(String path, long time, JFrame parent)
|
||||||
{
|
{
|
||||||
parentFrame = parent;
|
|
||||||
setBackground(new Color(0, 255, 0, 0)); // Transparency.
|
setBackground(new Color(0, 255, 0, 0)); // Transparency.
|
||||||
image = Toolkit.getDefaultToolkit().getImage(path);
|
image = Toolkit.getDefaultToolkit().getImage(path);
|
||||||
ImageIcon imageIcon = new ImageIcon(image);
|
ImageIcon imageIcon = new ImageIcon(image);
|
||||||
@ -58,14 +56,14 @@ public class SplashScreen extends JWindow
|
|||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
if (parentFrame != null)
|
if (parent != null)
|
||||||
{
|
{
|
||||||
// Make parent visible.
|
// Make parent visible.
|
||||||
parentFrame.setVisible(true);
|
parent.setVisible(true);
|
||||||
// Focus parent window.
|
// Focus parent window.
|
||||||
parentFrame.toFront();
|
parent.toFront();
|
||||||
parentFrame.setState(Frame.ICONIFIED);
|
parent.setState(Frame.ICONIFIED);
|
||||||
parentFrame.setState(Frame.NORMAL);
|
parent.setState(Frame.NORMAL);
|
||||||
}
|
}
|
||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,6 @@ import javax.swing.JWindow;
|
|||||||
public class SplashScreen extends JWindow
|
public class SplashScreen extends JWindow
|
||||||
{
|
{
|
||||||
Image image;
|
Image image;
|
||||||
JFrame parentFrame;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param path of image file
|
* @param path of image file
|
||||||
@ -43,7 +42,6 @@ public class SplashScreen extends JWindow
|
|||||||
*/
|
*/
|
||||||
public SplashScreen(String path, long time, JFrame parent)
|
public SplashScreen(String path, long time, JFrame parent)
|
||||||
{
|
{
|
||||||
parentFrame = parent;
|
|
||||||
setBackground(new Color(0, 255, 0, 0)); // Transparency.
|
setBackground(new Color(0, 255, 0, 0)); // Transparency.
|
||||||
image = Toolkit.getDefaultToolkit().getImage(path);
|
image = Toolkit.getDefaultToolkit().getImage(path);
|
||||||
ImageIcon imageIcon = new ImageIcon(image);
|
ImageIcon imageIcon = new ImageIcon(image);
|
||||||
@ -58,14 +56,14 @@ public class SplashScreen extends JWindow
|
|||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
if (parentFrame != null)
|
if (parent != null)
|
||||||
{
|
{
|
||||||
// Make parent visible.
|
// Make parent visible.
|
||||||
parentFrame.setVisible(true);
|
parent.setVisible(true);
|
||||||
// Focus parent window.
|
// Focus parent window.
|
||||||
parentFrame.toFront();
|
parent.toFront();
|
||||||
parentFrame.setState(Frame.ICONIFIED);
|
parent.setState(Frame.ICONIFIED);
|
||||||
parentFrame.setState(Frame.NORMAL);
|
parent.setState(Frame.NORMAL);
|
||||||
}
|
}
|
||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,6 @@ import javax.swing.JWindow;
|
|||||||
public class SplashScreen extends JWindow
|
public class SplashScreen extends JWindow
|
||||||
{
|
{
|
||||||
Image image;
|
Image image;
|
||||||
JFrame parentFrame;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param path of image file
|
* @param path of image file
|
||||||
@ -43,7 +42,6 @@ public class SplashScreen extends JWindow
|
|||||||
*/
|
*/
|
||||||
public SplashScreen(String path, long time, JFrame parent)
|
public SplashScreen(String path, long time, JFrame parent)
|
||||||
{
|
{
|
||||||
parentFrame = parent;
|
|
||||||
setBackground(new Color(0, 255, 0, 0)); // Transparency.
|
setBackground(new Color(0, 255, 0, 0)); // Transparency.
|
||||||
image = Toolkit.getDefaultToolkit().getImage(path);
|
image = Toolkit.getDefaultToolkit().getImage(path);
|
||||||
ImageIcon imageIcon = new ImageIcon(image);
|
ImageIcon imageIcon = new ImageIcon(image);
|
||||||
@ -58,14 +56,14 @@ public class SplashScreen extends JWindow
|
|||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
if (parentFrame != null)
|
if (parent != null)
|
||||||
{
|
{
|
||||||
// Make parent visible.
|
// Make parent visible.
|
||||||
parentFrame.setVisible(true);
|
parent.setVisible(true);
|
||||||
// Focus parent window.
|
// Focus parent window.
|
||||||
parentFrame.toFront();
|
parent.toFront();
|
||||||
parentFrame.setState(Frame.ICONIFIED);
|
parent.setState(Frame.ICONIFIED);
|
||||||
parentFrame.setState(Frame.NORMAL);
|
parent.setState(Frame.NORMAL);
|
||||||
}
|
}
|
||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user