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.

Bug 214676

Summary: Default font for JList is not correct
Product: guibuilder Reporter: zcotter
Component: CodeAssignee: issues@guibuilder <issues>
Status: RESOLVED DUPLICATE    
Severity: normal CC: zcotter
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: Windows 7 x64   
Issue Type: DEFECT Exception Reporter:

Description zcotter 2012-06-24 21:56:20 UTC
The default font in the properties panel for JList says Tahoma 11 Plain.  The default font for an actual JList is Tahoma 11 BOLD, so if you actually want the font to be Tahoma 11 Plain, you must set it manually after the initComponents() method is called. This causes confusion if you are using HTML to change the font/style from other parts of the program.
Comment 1 Tomas Pavek 2012-08-30 09:29:54 UTC
The problem here is that there is a different default font for the Look and Feel used by the IDE and the Look and Feel in which your application runs. In your case it's likely Windows L&F for the IDE and then you run the app without any L&F set, so you get the Metal L&F which uses the bold fonts (but I don't think it is Tahoma).

There is indeed the problem in GUI builder that does not allow to "force" setting of a font property even if it is default (because it might not be default in runtime). It's already reported in bug 136260 I think.

But it's generally quite rare to set explicit fonts on components, it's not a good practice. In the case you describe it seems to me like you'd actually want to run your app in a different L&F that will use the font you want. For that have look at at code that is provided in main method when you create a new JFrame. It sets the L&F to Nimbus (also not using bold fonts). If you comment out the 'for' cycle and just use:
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
you get the system L&F (Windows L&F in your case) which will make your app look closest to the native applications. NetBeans also uses this L&F.

Even in case you want to stay with the Metal L&F you have, it's still unusual to set the full font specification, including the font name. Note that in the font property editor you can specify to just change the font "thickness" to "plain". This will be possible even in the case you describe, and when running the GUI form, it will keep the actual font, just not bold.

*** This bug has been marked as a duplicate of bug 136260 ***