How to get the windows native look in Java GUI programming?

0 votes

I am new to Java programming and want to know whether it is possible to get the windows native look in Java GUI applications.

May 7 in Java by kartik
• 11,890 points
32 views

1 answer to this question.

0 votes

Hello Kartik,

 You can try the syntax:

UIManager.setLookAndFeel(PLAF); (Pluggable Look and Feel)

So, you must include the below 3 lines.

UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");

SwingUtilities.updateComponentTreeUI(frame);

updateComponentTreeUI(frame);

SwingUtilities.updateComponentTreeUI(frame) is used for refreshing the frame after the change.

Hope this is helpful!!
Thank You!!

answered May 7 by Niroj
• 23,950 points

Related Questions In Java

0 votes
1 answer

How to print java array in the simplest way?

String[] arr = new String[] {"John", "Mary", ...READ MORE

answered Apr 17, 2018 in Java by sophia
• 1,400 points
164 views
0 votes
2 answers

How to break the nested loop in Java?

You can use break with a label for the ...READ MORE

answered Sep 20, 2018 in Java by Sushmita
• 6,890 points
170 views
0 votes
1 answer

How to calculate the difference between two date instances in Java?

You can use Joda Time Library. Interval i ...READ MORE

answered May 4, 2018 in Java by Parth
• 4,640 points
116 views
0 votes
1 answer

How to read text files from the Classpath in Java?

InputStream in = this.getClass().getClassLoader().getResourceAsStream("TextFile.txt"); InputStream in = this.getClass().getResourceAsStream("/TextFile.txt"); package ...READ MORE

answered May 8, 2018 in Java by Akrati
• 3,150 points
933 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 963 views
0 votes
0 answers
0 votes
1 answer

How to get the current working directory in Java?

Hello, Using java.nio.file.Path and java.nio.file.Paths, you can do the following to ...READ MORE

answered May 28 in Java by Niroj
• 23,950 points
53 views
0 votes
1 answer

How to run a Java program from the command line on Windows?

Hello @kartik, In case your Java class is ...READ MORE

answered Apr 9 in Java by Niroj
• 23,950 points
72 views