JOptionPane Cannot Override LookAndFeel's Font...

Discussion in 'Java' started by SuperChuck, Aug 5, 2003.

  1. SuperChuck

    SuperChuck Guest

    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?
    SuperChuck, Aug 5, 2003
    #1
    1. Advertising

  2. SuperChuck

    Alan Moore Guest

    On 5 Aug 2003 15:15:15 -0700, (SuperChuck)
    wrote:

    >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"?
    Alan Moore, Aug 6, 2003
    #2
    1. Advertising

  3. SuperChuck

    SuperChuck Guest

    Alan Moore <> wrote in message news:<>...
    > On 5 Aug 2003 15:15:15 -0700, (SuperChuck)
    > wrote:
    >
    > >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"?


    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?
    SuperChuck, Aug 6, 2003
    #3
  4. Look in javax.swing.plaf.basic.BasicLookAndFeel source for list of
    properties.

    (SuperChuck) wrote in message
    news:<>...
    > Alan Moore <> wrote in message news:<>...
    > > On 5 Aug 2003 15:15:15 -0700, (SuperChuck)
    > > wrote:
    > >
    > > >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"?

    >
    > 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?
    Sandip Chitale, Aug 7, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michele Damian

    Mac OS X LookAndFeel on Windows

    Michele Damian, Feb 25, 2006, in forum: Java
    Replies:
    1
    Views:
    9,642
  2. Replies:
    2
    Views:
    7,045
    Roedy Green
    Mar 8, 2006
  3. Chris

    Override Font tag

    Chris, Jun 26, 2006, in forum: HTML
    Replies:
    10
    Views:
    8,431
    Andy Dingley
    Jul 3, 2006
  4. =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=

    override default disabled font color

    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=, Jul 2, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,084
    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=
    Jul 2, 2007
  5. mttc
    Replies:
    2
    Views:
    2,361
    Roedy Green
    Jul 3, 2009
Loading...

Share This Page