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

Paul Reiners picture Paul Reiners · Sep 16, 2009 · Viewed 33.8k times · Source

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.

Answer

Reverend Gonzo picture Reverend Gonzo · Sep 16, 2009

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