views:

751

answers:

4

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.

A: 

It may depend on the 'Look and Feel' you are using, but for me Swing's default font is

DejaVu Sans - Plain

For most components the font size defaults to around 12 or 13

instanceofTom
A: 

It looks like it's Arial. That's what Identifont tells me and it looks right.

Paul Reiners
+3  A: 

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

Milan Ramaiya
Yes, thanks, that worked, although you forgot a pair of parentheses: UIManager.getDefaults().getFont("TabbedPane.font")It turned out to be Arial Bold, as I thought (for what it's worth).
Paul Reiners
A: 

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

camickr