This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Whenever I create a TitledBorder in NetBeans it is showing a plain font in the designer and in design previews. But when I actually execute my program, the TitledBorder is showing a bold font (tested with Kubuntu-8.04.1). The problem I run into looks like Issue#22938, but this issue is VERIFIED FIXED?!
Created attachment 75420 [details] Example picture showing the problem
Is this the only difference? Or are there more if you add more components? How does the form look if you invoke preview on Metal look & feel (see context menu of JFrame node)? It can be due to different look&feel NetBeans run on (compared to standalone java application). What is JDK version you use?
> Is this the only difference? Or are there more if you add more components? Yes, it is the only difference I am aware of. > How does the form look if you invoke preview on Metal look & feel (see context menu of JFrame node)? It still shows the TitledBorder (wrongly) in a plain font. > What is JDK version you use? Here are some details from the Help->About dialog: Product Version: NetBeans IDE 6.5 (Build 200811100614) Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15 System: Linux version 2.6.24-22-generic running on i386; ANSI_X3.4-1968; en_US (nb) Userdir: /home/ronny/.netbeans/6.5
Created attachment 75575 [details] 156242.jpg
>> How does the form look if you invoke preview on Metal look & feel (see context menu of JFrame node)? > It still shows the TitledBorder (wrongly) in a plain font. Wrongly? Your metal preview contains title rendered in a plain font. I thought that this is correct.
Workaround: Set default font (Dialog 11 Plain) manually - open "Border customizer" dialog - open "Font" custom editor - set title font using "Custom code" instead of using "Default editor" - use code : new java.awt.Font("Dialog", java.awt.Font.PLAIN, 11)
So looks like a problem only with TitledBorder font on Metal Look and Feel. NetBeans changes the l&f defaults slightly (fonts, colors, etc). The GUI builder must revert these changes to be able to show the forms the way they should look by default in a plain java application. Seems there's some problem in case of the TitledBorder font - the NetBeans font is used instead of the real default. However, this does not affect functionality, only the appearance of the title on Metal L&F.
> Seems there's some problem in case of the TitledBorder font - the NetBeans font is used instead of the real default. Thank you for finding and explaining the reason of this bug. > However, this does not affect functionality, only the appearance of the title on Metal L&F. I just happened to get several times a rude surprise when I created a dialog, chose fonts and borders in the designer to get a consistent look and feel but when actually running the program it looked completely different...
The sub-properties of border property were not initialized in GUI Builder's look and feel block. Unfortunately, there was one more problem with the TitledBorder itself. The TitledBorder doesn't remember default values of its properties - it everytime loads these values from UIDefaults. Hence, a simple initialization in our l&f block is not sufficient because it loads incorrect values from NetBeans IDE UIDefaults once we leave the l&f block. So, we have to push the default values back into TitledBorder. For example, we have to call border.setTitleFont(border.getTitleFont()) to force the border to remember its default value. Modified files: http://hg.netbeans.org/cdev/rev/53dc51b4ff21