I have a program that when you run it it freezes the desktop and is supposed to open a password prompt. However, the prompt opens up under the frozen desktop. Here is the code to freeze the desktop:
Java Code:
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Rectangle screenRectangle = new Rectangle(screenSize);
        Robot robot = new Robot();
        BufferedImage image = robot.createScreenCapture(screenRectangle);
        ImageIO.write(image, "png", new File("ScreenShot.png"));
        BufferedImage screen = ImageIO.read(new File("ScreenShot.png"));
        ImageIcon icon = new ImageIcon(screen);
        JLabel label = new JLabel(icon, JLabel.CENTER);
        JOptionPane.showMessageDialog(null, label, "icon", -1);
As you see it takes a screen shot and covers the screen. How do I force my other program on top of this? I have a third program that controlls all of the classes.
Java Code:
public class Run
{
    public static void main(String[] args) throws Exception
    {
        freezeScreen.run();
        checkPassword.run();
    }
}
Thanks