<AWT Dev> Review Request JDK-6421058: When calls JSpinner.setEditor() the font in a JSpinner become is a bold
prem.balakrishnan at oracle.com
Fri May 6 08:34:51 UTC 2016
Please review fix for JDK9,
1. The font of the text field is changed to the font of JSpinner if the font of text field was NOT set by the user.
2. The font of the text field is NOT changed to the font of JSpinner if the font of text field was set by the user.
Default Font for JSpinner is set to "MetalTheme.CONTROL_TEXT_FONT", which is by default BOLD.
MetalLookAndFeel derives it's color palette and fonts from MetalTheme.
As per Java docs:
DefaultMetalTheme uses bold fonts for many controls. To make all controls (with the exception of the internal frame title bars and client decorated frame title bars) use plain fonts you can do either of the following:
Set the system property swing.boldMetal to false. For example, java -Dswing.boldMetal=false MyApp.
Set the defaults property swing.boldMetal to Boolean.FALSE. For example: UIManager.put("swing.boldMetal", Boolean.FALSE);
As per analysis, Expected Behavior holds good, where as Expected Behavior fails to set the default font(i.e., Spinner's font) to TextField when TextField font is not set explicitly.
Here the issue is other way, i.e., The Font in JSpinner is NOT BOLD, before calling JSpinner.setEditor().
Because TextField Font is NOT SET to JSpinner Font during Initialization.
TextField Font is SET to JSpinner Font during Initialization.
Jtreg and JCK tests PASSED without causing any regression with the suggested fix, across all platforms (Win/Linux/Mac).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the awt-dev