JOptionPane Cannot Override LookAndFeel's Font...

S

SuperChuck

Okay, I've been digging in this for a few hours and thought I'd see if
anyone else has had this annoying little problem.

Under 1.4.1_01, I set the LookAndFeel to the default system L&F
(windows).

If I create a JLabel and set the Label.font below:

UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );
UIManager.put("Label.font", new Font("Dialog", Font.BOLD, 24));

....the system creates a font suitable for viewing from space.

HOWEVER, if I attempt to use JOptionPane.showMessageDialog(), I get
the system's default font (from the windows L&F, I assume).

I thought maybe it was inheriting the font from one of its parents, so
I set everything I could think of to use my lovely 24 point font, but
to no avail...

Anyone have any insight?
 
A

Alan Moore

Okay, I've been digging in this for a few hours and thought I'd see if
anyone else has had this annoying little problem.

Under 1.4.1_01, I set the LookAndFeel to the default system L&F
(windows).

If I create a JLabel and set the Label.font below:

UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );
UIManager.put("Label.font", new Font("Dialog", Font.BOLD, 24));

...the system creates a font suitable for viewing from space.

HOWEVER, if I attempt to use JOptionPane.showMessageDialog(), I get
the system's default font (from the windows L&F, I assume).

I thought maybe it was inheriting the font from one of its parents, so
I set everything I could think of to use my lovely 24 point font, but
to no avail...

Anyone have any insight?

Have you tried setting the UI property "OptionPane.messsageFont"?
 
S

SuperChuck

Alan Moore said:
Have you tried setting the UI property "OptionPane.messsageFont"?

I knew I was missing something simple, but I had no idea it was THAT
simple!
(I was filtering the list of available properties using the String
"font", not "Font"... ARGH!)

Off hand, does anyone know a good website with a listing of L&F
properties and their meaning?
 
S

Sandip Chitale

Look in javax.swing.plaf.basic.BasicLookAndFeel source for list of
properties.

(e-mail address removed) (SuperChuck) wrote in message
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top