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

Vista Sidebar confounds Menu Placement

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: client-libs

      Description

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

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft® Windows Vistaâ„¢ Business
      Version 6.0.6000 Build 6000


      EXTRA RELEVANT SYSTEM CONFIGURATION :
      We are using the Windows LAF on Vista.

      A DESCRIPTION OF THE PROBLEM :
      When you open a menu on the far right of a JMenuBar, the position of the newly opened menu is calculated incorrectly if Windows Vista Sidebar is running.

      I have also had reports of this occurring with the Google Sidebar, too.



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile and run the source code that I've provided. You should get a small, empty JFrame with a single menu in its menubar (on the far right, where some applications put their "Help" menu.)

        To see things behaving normally:

      1) shut off Windows Vista Sidebar if it is running.

      2) maximize the JFrame, or just resize/drag it so that its right edge is very close to the right edge of your screen. (If you have multiple monitors, do this on your leftmost monitor.)

      3) open and close the menu by clicking on it with your mouse. Note the position of the menu, i.e. it's right underneath your mouse, weighted toward the left because there's no room for it on the right.

        To see the problem:

      1) Turn on Windows Vista Sidebar. In it's properties, make sure "Sidebar is always on top of other windows" is checked ON, and set it to display on the left side of your monitor. (Again, use your leftmost monitor if you have more than one.)

      2) Repeat steps 2 and 3 from the previous section. Note that this time, the menu does not appear in the correct location--it is now offset toward the center of the screen by an amount that seems suspiciously like the width of the Vista Sidebar.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Menu should be positioned correctly, as it is when Vista Sidebar is not running.
      ACTUAL -
      Menu is in the wrong spot when Vista Sidebar is running.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      No Errors.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;

      public final class BreakMenu {

         public static void main( String [] args ) {
            
            JMenu menu = new JMenu("Menu");
            menu.add( new JMenuItem("MenuItem 1") );
            menu.add( new JMenuItem("MenuItem 2") );
            menu.add( new JMenuItem("MenuItem 3") );
            
            JMenuBar menubar = new JMenuBar();
            menubar.add( Box.createHorizontalGlue() );
            menubar.add( menu );

            JFrame frame = new JFrame();
            frame.setJMenuBar( menubar );
            frame.setSize(500, 500);
            frame.setLocation(100,100);
            frame.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
            frame.setVisible( true );
         }
      }
      ---------- END SOURCE ----------

        Attachments

          Activity

            People

            Assignee:
            rupashka Pavel Porvatov (Inactive)
            Reporter:
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: