Solved

Look & Feel

Posted on 2004-10-27
326 Views
Last Modified: 2007-12-19
I'm using JGoodies Look & Feel for my application.  When I run the application under Windows XP and I get a very nice looking GUI.  If I run the same application on a Windows 2000 box, the GUI takes on those features...which is what I do not want.  How do I keep the XP L&F under 2000 with JGoodies?

Here is my code initializing JGoodies:

    public void SetLookFeel(){
        String lafName =
        LookUtils.IS_OS_WINDOWS_XP
        ? Options.getCrossPlatformLookAndFeelClassName()
        : Options.getSystemLookAndFeelClassName();
       
        try {
            UIManager.setLookAndFeel(lafName);
        }
        catch(Exception e){
            System.err.println("Can't set look & feel:" + e);
        }
    }

Thanks,
David
0
Question by:lomidien
    4 Comments
     
    LVL 2

    Expert Comment

    by:Breadstick
    > String lafName =
    > LookUtils.IS_OS_WINDOWS_XP
    >        ? Options.getCrossPlatformLookAndFeelClassName()
    >        : Options.getSystemLookAndFeelClassName();

    So... if your using Windows XP, you'll get the default Java cross platform look and feel.  Otherwise, you'll get your system look and feel.  Where do you set the look and feel to the JGoodies one?
    0
     

    Author Comment

    by:lomidien
    How do I set it so that it is JGoodies as opposed to the standard L&F for the OS?
    0
     
    LVL 92

    Accepted Solution

    by:
    use the class name of the JGoodies L&F.
    0
     
    LVL 92

    Expert Comment

    by:objects
    either:
          UIManager.setLookAndFeel(new Plastic3DLookAndFeel());

    Or use one of the following class names:

    com.jgoodies.plaf.windows.ExtWindowsLookAndFeel
    com.jgoodies.plaf.plastic.PlasticLookAndFeel
    com.jgoodies.plaf.plastic.Plastic3DLookAndFeel
    com.jgoodies.plaf.plastic.PlasticXPLookAndFeel
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Cisco Complete Network Certification Training

    If you’re an IT engineer or technician, it's time you take your career to the next level. This elite training bundle is brimming with all of the information you need to learn to sit for Cisco CNNA, CCNP, and CCENT certification exams.

    An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
    Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

    846 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now