Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5844559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:18:36+00:00 2026-05-22T12:18:36+00:00

I am experimenting with the Java UIManager and the use of different Look and

  • 0

I am experimenting with the Java UIManager and the use of different Look and Feels. I am rapidly discovering that it is not simply a matter of setting the look and feel at the beginning of the applet and miraculously seeing the resulting changes to the UI. What I’m finding is that with certain LAF’s I will find odd unpredictable behaviors and failures. For example, when I set the font of a JLabel to Arial with a size of 8 and a face of bold, the resulting text will be a single dash “-” instead of the specified text using the Windows or Classic Windows LAF. In other cases, like the Mac LAF, the JTrees’s stop working (I’m implementing my application on a Windows platform). So I’m wondering, is there a set of steps that need to be followed when changing the Java LAF so that whatever LAF I chose, I can be assured of reliable and predictable behavior from the rest of Swing? Are only certain LAF’s robust and the rest are for only the brave at heart?

Thank you in advance for your response.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:18:37+00:00Added an answer on May 22, 2026 at 12:18 pm

    I do not know how to answer your question precisely. All I can do is to show how I am running my apps with different UIs, please see below. The example shows how I am installing one of Look and Feels from the Substance library.

            public static void main(String[] argv) throws InterruptedException, InvocationTargetException
            {
                SwingUtilities.invokeLater(new Runnable()
                {
                    @Override
                    public void run()
                    {
                        try
                        {
                            UIManager.setLookAndFeel(new SubstanceSaharaLookAndFeel());
                            //Some people say the below should also be called but even without it always worked for me so what is this for then?
                            //SwingUtilities.updateComponentTreeUI(frame);
                        }catch(Exception e)
                        {
                            Logger.getLogger(MyApplicationFrame.class.getName()).log(Level.SEVERE, null, e);
                            System.out.println("Substance look and feel failed to initialize");
                        }
                        new MyApplicationFrame();
                    }
                });
            }
    

    As to the comment in the code regarding call to SwingUtilities.updateComponentTreeUI(frame); I would guess it is needed when you are changing your Look and Feel when the application is already running.

    Hope it is of any help to you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While experimenting with this question on collections in Spring.NET , I discovered that Spring
I'm experimenting with internationalization by making a Hello World program that uses properties files
I'm experimenting Java Multi-Threading using synchronization on method comparing with Atomic variables (java.util.concurrent.atomic package).
I'm experimenting w/java sockets. I can connect to a socket and send/receive bytes of
I'm experimenting with java annotation processors. I'm able to write integration tests using the
I just started experimenting with java today (have experience with javascript and PHP) and
I've been learning and experimenting with Java Generics for a while but I have
I've been experimenting with various bits of Java code trying to come up with
I am experimenting with OpenRules and Java and I'd like to store all my
I'm experimenting with generics in Java, and thought of this example. If I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.