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

Cannot resize CheckBoxItemMenu in Synth L&F with setHorizontalTextPosition

XMLWordPrintable

    • b13
    • x86_64
    • windows_10

      A DESCRIPTION OF THE PROBLEM :
      Using a Synth Look and Feel, JCheckBoxMenuItem cannot resize after setHorizontalTextPosition. This occurs only with jdk 1.8.0_152 or higher. With JDK 1.5.0_151 or older the problem doesn't occur.

      REGRESSION : Last worked in version 8u172


      ---------- BEGIN SOURCE ----------
      // Set synth look an feel

                      JFrame frame = new JFrame();
      frame.setTitle("Test");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

      JMenuBar menuBar = new JMenuBar();
      JMenu menu = new JMenu("Options");
                      JCheckBoxMenuItem colorKeyCheckBox = new JCheckBoxMenuItem();
      colorKeyCheckBox.setSelected(false);
      colorKeyCheckBox.setMnemonic(KeyEvent.VK_K);
      colorKeyCheckBox.setText("Show Color Key");
      colorKeyCheckBox.setHorizontalTextPosition(JCheckBoxMenuItem.LEADING);
      colorKeyCheckBox.setVerticalTextPosition(JCheckBoxMenuItem.CENTER);

                      menu.add(colorKeyCheckBox);

                      menuBar.add(menu);

      frame.setJMenuBar(menuBar);
      frame.setPreferredSize(new Dimension(500, 500));
      frame.pack();
      frame.setVisible(true);
      ---------- END SOURCE ----------

      FREQUENCY : always


            pbansal Pankaj Bansal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: