Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Java look like Windows programs?

Is there a way (using Java) to make the GUIs that you create look like normal Windows programs? I don't like the look and feel of the Java buttons and scrollers and stuff... It can use those if it's running on Mac or Linux, but I'd like it to inherit the buttons and stuff from Windows. Any suggestions?

like image 231
Paulywog Avatar asked May 19 '12 21:05

Paulywog


People also ask

How do I set Java look and feel?

To programmatically specify a L&F, use the UIManager. setLookAndFeel() method with the fully qualified name of the appropriate subclass of LookAndFeel as its argument.

Which is better Java Swing or JavaFX?

From a Java developer perspective, both technologies are highly useful in writing pluggable UI components. With its vast UI component library, Swing can provide added advantage to the developer, whereas when it comes to design modern and rich internet application, JavaFX can supersede Swing.

What is pluggable look and feel in Java?

Pluggable look and feel is a mechanism used in the Java Swing widget toolkit allowing to change the look and feel of the graphical user interface at runtime.


1 Answers

You can set the look and feel of any Swing program to the native operating system's with one call.

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())

The Windows PLAF can be seen in the Nested Layout Example.

like image 199
Jeffrey Avatar answered Sep 28 '22 04:09

Jeffrey