JDK-6840112 : NimbusLAF JMenu
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u10
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2009-05-12
  • Updated: 2011-01-19
  • Resolved: 2010-08-20
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_12"
Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
Java HotSpot(TM) Client VM (build 11.2-b01, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP

A DESCRIPTION OF THE PROBLEM :
If a JMenu with ComponentOrientation.RIGHT_TO_LEFT is put in another JMenu then the arrow symbol which then appears on the left should point left and not right as it does currently.


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
JMenu's in Ocean and Metal have Arrows which point LEFT when ComponentOrientation is set to RIGHT_TO_LEFT.

ACTUAL -
JMenu's in Nimbus have Arrows which point RIGHT when ComponentOrientation is set to RIGHT_TO_LEFT.


REPRODUCIBILITY :
This bug can be reproduced always.

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

public class JMenuTest extends JFrame
{
   public JMenuTest()
   {
      JMenu  helpMenu = new JMenu("Help");
      helpMenu.applyComponentOrientation( ComponentOrientation.RIGHT_TO_LEFT );
	  
      JMenu  subMenu = new JMenu("The Arrow");
      subMenu.applyComponentOrientation( ComponentOrientation.RIGHT_TO_LEFT );
      subMenu.add( new JMenuItem( "Should point LEFT !?" ));
      helpMenu.add( subMenu );

      JMenuBar  mBar = new JMenuBar();
	  mBar.add( Box.createHorizontalGlue() );
      mBar.add( helpMenu );
      setJMenuBar( mBar );
	  
	  setDefaultCloseOperation( EXIT_ON_CLOSE );
      setSize( 300,240 );
      setVisible( true );
   }

   public static void main( String[] args )
   {
	  try {
         UIManager.setLookAndFeel( new com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel() );
      }
	  catch ( UnsupportedLookAndFeelException  USLF )
	  {
		  System.err.println("This Test Needs Nimbus !");
      }
      new JMenuTest();
   }
}
---------- END SOURCE ----------

Comments
PUBLIC COMMENTS Fixed in jdk7.
20-08-2010

EVALUATION This problem may be fixed by 6458123
15-05-2009