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

JMenuItem appears on wrong monitor

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 6
    • client-libs
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.6.0"
      Java(TM) SE Runtime Environment (build 1.6.0-b105)
      Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP Media Center Edition AND
      Windows XP SP2

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Dual Monitor, 2nd monitor is to the left of 1st monitor

      A DESCRIPTION OF THE PROBLEM :
      This problem occurs when the user changes their display settings to include a second display to the left of the first display. Clicking on the menu in the second display does not act as it should, the menu appears on the first display.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Disable second display. Start java application with frame with a menu. Enable second display to left of first one. Move frame to second display. Click menu.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Menu should appear in usual position relative to menubar/frame.
      ACTUAL -
      Menu appears on the other display.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 1
      at sun.awt.windows.WWindowPeer.updateGC(Unknown Source)
      at sun.awt.windows.WWindowPeer.displayChanged(Unknown Source)
      at sun.awt.windows.WWindowPeer$1.run(Unknown Source)
      at java.awt.event.InvocationEvent.dispatch(Unknown Source)
      at java.awt.EventQueue.dispatchEvent(Unknown Source)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.run(Unknown Source)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.event.ActionEvent;
      import java.awt.event.ActionListener;

      import javax.swing.JFrame;
      import javax.swing.JMenu;
      import javax.swing.JMenuBar;
      import javax.swing.JMenuItem;

      public class FrameTest {
      JFrame frame = new JFrame ("Test");
      JMenuBar menuBar = new JMenuBar ();
      JMenu menu = new JMenu ("File");
      JMenuItem menuItem = new JMenuItem ("Close");
      public static void main (String [] args) {
      new FrameTest ();
      }
      public FrameTest () {
      frame.setJMenuBar(menuBar);
      menuBar.add(menu);
      menu.add(menuItem);
      menuItem.addActionListener (new ActionListener () {
      public void actionPerformed(ActionEvent arg0) {
      System.exit(0);
      }
      });
      frame.setSize(640,480);
      frame.setVisible(true);
      }
      }

      ---------- END SOURCE ----------

            Unassigned Unassigned
            ryeung Roger Yeung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: