JDK-8216329 : Cannot resize CheckBoxItemMenu in Synth L&F with setHorizontalTextPosition
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 8u152,9,11,12
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_10
  • CPU: x86_64
  • Submitted: 2019-01-04
  • Updated: 2020-03-10
  • Resolved: 2020-02-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 15
15 b13Fixed
Related Reports
Relates :  
Description
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



Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/c28ebdb28a8e User: psadhukhan Date: 2020-03-03 09:13:24 +0000
03-03-2020

URL: https://hg.openjdk.java.net/jdk/client/rev/c28ebdb28a8e User: pbansal Date: 2020-02-21 11:17:07 +0000
21-02-2020

This is a regression of https://bugs.openjdk.java.net/browse/JDK-8152981
20-01-2020

With Synth Look and Feel, JCheckBoxMenuItem fails to resize after setHorizontalTextPosition. Verified this for reported version and could confirm the issue. Results: ======== 8u151: OK 8u152: Fail 8u191: Fail 9: Fail 12 ea b25: Fail This is a regression introduced in JDK 8u152. To verify, run the attached test case with respective JDK versions.
08-01-2019