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 8661551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:31:25+00:00 2026-06-12T16:31:25+00:00

I have been looking over the internet (expescially StackOverflow of course :) ) for

  • 0

I have been looking over the internet (expescially StackOverflow of course 🙂 ) for the following issue.
Netbeans offers a ‘great’ default look and feel, so i want to change that to a native look. With this I mean, the running program doesn’t look equal to the designed GUI. So when youre designing on a Windows pc, the program looks like Windows, and so for Mac etc.

So, I searched on this website, found a lot of times an example code like this:

private void setLookAndFeel() {
    // Get the native look and feel class name
    String nativeLF = UIManager.getSystemLookAndFeelClassName();
    try {
        UIManager.setLookAndFeel(nativeLF);
    } catch (ClassNotFoundException | InstantiationException | 
IllegalAccessException | UnsupportedLookAndFeelException ex) {
        Logger.getLogger(GUI.class.getName()).log(Level.SEVERE, null, ex);
    }
}

source: http://www.exampledepot.com/egs/javax.swing/LookFeelNative.html

But… it wont work for me.

I ‘ll get a nullpointerexception, that is very long (584 lines).

I hope someone can help me.

Thanks in advance!

Dave

Backgroundinformation:
– Netbeans 7.1.2
– Windows 7
– wont work like this: http://www.exampledepot.com/egs/javax.swing/LookFeelNative.html

  • 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-06-12T16:31:26+00:00Added an answer on June 12, 2026 at 4:31 pm
     UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    

    The above will give windows look and feel, when it is inside WINDOWS. If in Linux, then the Linux look and feel. Best place to use this is inside your main method, something like following

     */
    public class MyPhoneBookApp {
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) 
        {
            try
            {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                new MainForm();
            }
            catch(Exception e)
            {
                e.printStackTrace();
            }
        }
    }
    

    If you need a look and feel that doesn’t change based on the OS, and something really nice, look at the following links which contains look and feel Jars

    http://www.javootoo.com/

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

Sidebar

Related Questions

I have been looking over the internet for a while about this, but it
I have been looking all over the internet and i found some good guides
Right guys, I have been looking all over the internet for a tutorial to
I have been looking over the internet, but could not find the perfect tutorial
I have been searching over the internet for the past few hours looking for
I have been looking over StackOverflow and have not found any answers yet, if
I have been looking all over the Internet for an answer to this question
I have been looking all over the Internet for this and have found similar,
I have been looking all over the internet (googling pretty much) and have found
I have been scouring the internet for over a week now looking for a

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.