Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6580925

Swing Popups don't get hidden on Alt+Tab

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • 7
    • 7
    • client-libs
    • generic
    • generic

      On Windows OS all popups are get hidden when you press Alt+Tab,
      I think it should happen on GTK as well

      This bug is very visible with the JTrayIcon draft implementation

      Expected:
      You press Alt+Tab and popups are closed

      Actual:
      Popups stay open

      To check it use the following test:

      import javax.swing.*;

      public class PopupTest {

          private static void createGui() {
              final JFrame frame = new JFrame();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

              JPopupMenu menu = new JPopupMenu("Menu");
              menu.add(new JMenuItem("MenuItem"));
              menu.add(new JMenuItem("MenuItem"));
              menu.add(new JMenuItem("MenuItem"));
              menu.add(new JMenuItem("MenuItem"));
              menu.add(new JMenuItem("MenuItem"));

              JPanel panel = new JPanel();
              panel.setComponentPopupMenu(menu);
              frame.add(panel);

              frame.setSize(200, 200);
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
          }

          public static void main(String[] args) throws Exception {
              SwingUtilities.invokeLater(new Runnable() {
                  public void run() {
                      PopupTest.createGui();
                  }
              });
          }
      }

            son Oleg Sukhodolsky (Inactive)
            alexp Alexander Potochkin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: