Problem with UIManager.setLookAndFeel()

Discussion in 'Java' started by Fencer, Apr 15, 2009.

  1. Fencer

    Fencer Guest

    Hi!

    In my program I use UIManager.setLookAndFeel() to set a native look and
    feel (using UIManager.getSystemLookAndFeelClassName() as the argument)
    and it has been working great...until now.

    I exported my app as a runnable jarfile and tried it on my boss'
    computer that is running Windows XP and Java 1.6.0_07 and the entire
    client area of the GUI is grey. The menus work however and the program
    responds to commands.

    I tracked it down to my usage of UIManager.setLookAndFeel() as I
    described above. Funny thing is that setLookAndFeel() doesn't throw any
    exceptions and the classname returned is the same as on my workstation
    (that's running Windows Vista and I use Eclipse to develop this
    application, my workstation also has Java 1.6.0_13).

    On my boss' computer, an older version of the program is available as an
    eclipse project and that version does the same setLookAndFeel()-stuff
    and that works just fine.

    I'm wondering what to do now because we want to have a native look and
    feel for this program.

    I think I will try to run the latest version of the program from within
    eclipse on my boss' computer and see what happens. I didn't want to
    upgrade the Java version right away until I have done some more tests.

    I was just wondering if anyone has seen this behavior and isn't odd that
    setLookAndFeel() didn't throw any exceptions even though the entire
    client area turns into a blank gray rectangle?

    As a work-around for now I've introduced a command line argument that
    disables the attempt to set a native look and feel.

    - Fencer
    Fencer, Apr 15, 2009
    #1
    1. Advertising

  2. Fencer

    sajin

    Joined:
    Nov 17, 2010
    Messages:
    1
    I am getting the same problem.We have migrated Swing application from java 1.4 to java 1.6.All the buttons after migration are greyed out.
    sajin, Nov 17, 2010
    #2
    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. Andreas Suurkuusk
    Replies:
    0
    Views:
    3,952
    Andreas Suurkuusk
    Jul 27, 2003
  2. Ted Miller
    Replies:
    0
    Views:
    5,139
    Ted Miller
    Sep 13, 2003
  3. Zerex71

    Help! Where's my UIManager

    Zerex71, Apr 29, 2008, in forum: Java
    Replies:
    6
    Views:
    343
    Zerex71
    Apr 30, 2008
  4. gbattine
    Replies:
    3
    Views:
    1,572
    Roedy Green
    Sep 15, 2011
  5. Mike

    Problem problem problem :( Need Help

    Mike, May 7, 2004, in forum: ASP General
    Replies:
    2
    Views:
    533
    Bullschmidt
    May 11, 2004
Loading...

Share This Page