title: How to make JOptionPane on top of a Fullscreen Window?
body: <p>I couldn't find any spesific solution for Fullscreen Window so I want to ask. How to make a JOptionPane on the top of a Fullscreen Window? </p>
  
  <p>In here , Im taking a Fullscreen window as a constructor parameter. But when I press ESC , my window sending itself to background, like I pressed "Alt+Tab". Then if I click on if from start menu bar , I can see it on top of window. But I want to end this sending background problem.How can I fix it?</p>
  
  <pre><code>import java.awt.event.KeyEvent;
  import java.awt.event.KeyListener;
  import javax.swing.*;
  import java.awt.*;
  
  public class KeyListenerTest extends JFrame implements KeyListener {
    private Window windo;
    private ImageIcon quitImage;
  
    public KeyListenerTest(Window window)
    {
      quitImage = new ImageIcon("quitask.png");
      windo = window;
      addKeyListener(this);
    }
  
    public void keyPressed(KeyEvent e) {  
      if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
        JOptionPane opti = new JOptionPane();
        int choice = opti.showConfirmDialog(windo, "Do you really want to quit?", "QUIT", JOptionPane.YES_NO_OPTION , 
                                            JOptionPane.QUESTION_MESSAGE  , quitImage);
        opti.requestFocusInWindow();
        if(choice == JOptionPane.YES_OPTION)
        {
          System.exit(0);
        }
        else
        {
          dispose();
          System.out.println("ESC key typed");
        }
      }
    }  
    public void keyTyped(KeyEvent e) {
    }
  
    public void keyReleased(KeyEvent e) {
    } 
  }
  </code></pre>
  
  <p>And here is my code for making my window fullscreen</p>
  
  <pre><code>  window=(Window)frame;
    window.setFocusable(true);
  
    KeyListenerTest keyo = new KeyListenerTest(window);
    frame.addKeyListener(keyo);
  
    g.setFullScreenWindow(window);
  </code></pre>