JDK-7095092 : javax.swing.border.TitledBorder does to not have a default TitleFont
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: linux
  • CPU: x86
  • Submitted: 2011-09-26
  • Updated: 2012-03-20
  • Resolved: 2011-09-27
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 8
8Resolved
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Linux XXX 2.6.40.4-5.fc15.x86_64 #1 SMP Tue Aug 30 14:38:32 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
In the class javax.swing.border.TitledBorder the method getTitleFont() does not have a default font if one is not specifically set in the constructor. Previous versions of Java returned a default font instead of null.

REGRESSION.  Last worked in version 6u26


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
TitledBorder b = BorderFactory.createTitledBorder(BorderFactory.createLineBorder(new Color(0, true)), title);
b.setTitleFont(b.getTitleFont().deriveFont(Font.PLAIN, 10f));
---------- END SOURCE ----------

Comments
EVALUATION This is not a bug. Specification doesn't say anything about default title font. But according bean specification getters and setters should be consistent and now getTitleFont and setTitleFont works as expected. BTW: getTitleFont was changed in CR 4129681
28-09-2011