Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the default font for Swing JTabbedPane labels?

Does the text in Swing components have a default font? In particular, what about tab labels on JTabbedPanes?

I'm working on a mock-up of a GUI made with Swing and want it to blend it with a screen image I grabbed of a Swing app.

like image 754
Paul Reiners Avatar asked Sep 16 '09 16:09

Paul Reiners


People also ask

What is the default font for Jlabel?

It doesn't have a default font. It depends on what LookandFeel you are using. It gave me a null value, but label.

What fonts are available in Java?

Logical fonts are the five font families defined by the Java platform which must be supported by any Java runtime environment: Serif, SansSerif, Monospaced, Dialog, and DialogInput.


2 Answers

It depends on the Look and Feel. If it's an application you've written, get the values from UIManager.getDefaults().getFont("TabbedPane.font")

like image 181
Reverend Gonzo Avatar answered Oct 12 '22 11:10

Reverend Gonzo


The UIManager Defaults shows what the values are for all properties for all components (including "TabbedPane.font").

like image 33
camickr Avatar answered Oct 12 '22 13:10

camickr