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

SwingSet2 throws NPE when selecting a LAF from the popup menu on sec. screen

XMLWordPrintable

    • generic
    • generic

      I am running SwingSet2 on a multi-monitor environment and I am popping up another instance of SwingSet2 on the secondary monitor through the 'multiscreen' menu. When SwingSet2 appears on secondary monitor, I am clicking 'SHIFT + F10' to bring up the popup menu for changing the LAF. When I select a different look & feel from the popup menu, a NullPointerException is thrown in the console. After that, when I bring up the popup menu again, I see all the options being shown as selected in the popup menu.

      This is reproducible on all platforms with multiple-monitors. I reproduced it on Solaris9 and WinXP. This is reproducible on Tiger as well as Mustang.

      To reproduce the bug, do the following:
      1. Run SwingSet2 on a multi-screen setup
      2. Click Multiscreen menu and create an instance on the secondary screen (other screen).
      3. Once SwingSet2 comes up on the sec. screen, click it and press 'SHIFT + F10'.
      4. A popup menu would appear. Choose a look & feel - say Motif.
      5. If you see the following NPE on the console, the bug is reproduced.

      Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
      at SwingSet2.setLookAndFeel(SwingSet2.java:1030)
      at SwingSet2$ChangeLookAndFeelAction.actionPerformed(SwingSet2.java:1218)
      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1851)
      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2171)
      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
      at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
      at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
      at javax.swing.plaf.basic.BasicPopupMenuUI$Actions.doReturn(BasicPopupMenuUI.java:419)
      at javax.swing.plaf.basic.BasicPopupMenuUI$Actions.actionPerformed(BasicPopupMenuUI.java:39)
      at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1576)
      at javax.swing.JComponent.processKeyBinding(JComponent.java:2793)
      at javax.swing.KeyboardManager.fireBinding(KeyboardManager.java:255)
      at javax.swing.KeyboardManager.fireKeyboardAction(KeyboardManager.java:204)
      at javax.swing.JComponent.processKeyBindingsForAllComponents(JComponent.java:2870)
      at javax.swing.JComponent.processKeyBindings(JComponent.java:2862)
      at javax.swing.JComponent.processKeyEvent(JComponent.java:2756)
      at java.awt.Component.processEvent(Component.java:5265)
      at java.awt.Container.processEvent(Container.java:1966)
      at java.awt.Component.dispatchEventImpl(Component.java:3955)
      at java.awt.Container.dispatchEventImpl(Container.java:2024)
      at java.awt.Component.dispatchEvent(Component.java:3803)
      at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1810)
      at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:68)
      at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:916)
      at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:794)
      at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:632)
      at java.awt.Component.dispatchEventImpl(Component.java:3841)
      at java.awt.Container.dispatchEventImpl(Container.java:2024)
      at java.awt.Window.dispatchEventImpl(Window.java:1766)
      at java.awt.Component.dispatchEvent(Component.java:3803)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

            Unassigned Unassigned
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: