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

Motif L+F JCheckBoxMenuItems don't align the text properly

XMLWordPrintable

    • sparc
    • solaris_2.5.1

      In a menu with both textual items and check box items the left edges
      of the text should be aligned. In the Motif L+F, the left edge of the
      check box is aligned with the left edge of the textual items.

      Name: apR10133 Date: 08/16/2001


      There is a testcase for this bug:
      ------------------------ bug4133790.java ---------------------------
      import javax.swing.*;

      public class bug4133790 {

          public bug4133790() {
      try {
      UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
      } catch (Exception e) {
      e.printStackTrace();
      }

      JFrame fr = new JFrame("Test");
      fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

      JMenuBar bar = new JMenuBar();
      fr.setJMenuBar(bar);

      JMenu menu = new JMenu("Menu");
      bar.add(menu);

      menu.add(new JMenuItem("simple item"));
      menu.add(new JCheckBoxMenuItem("checkbox item"));
      menu.add(new JRadioButtonMenuItem("checkbox item"));

      JMenu submenu = new JMenu("submenu");
      menu.add(submenu);
      submenu.add(new JMenuItem("simple item"));
      submenu.add(new JMenuItem("simple item"));

      JMenu menu2 = new JMenu("Test");
      bar.add(menu2);
      menu2.add(new JMenuItem("simple item"));
      menu2.add(new JMenuItem("simple item"));

      fr.setSize(200,200);
      fr.setVisible(true);
          }
          
          public static void main(String[] argv) {
      new bug4133790();
          }
      }
      ----------------------------------------------------------
      ###@###.###

      ======================================================================

            kizune Alexander Zuev
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: