Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 214676 - Default font for JList is not correct
Default font for JList is not correct
Status: RESOLVED DUPLICATE of bug 136260
Product: guibuilder
Classification: Unclassified
Component: Code
7.3
PC Windows 7 x64
: P3 (vote)
: TBD
Assigned To: issues@guibuilder
issues@guibuilder
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-24 21:56 UTC by zcotter
Modified: 2012-08-30 09:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo