Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java eclipse WindowBuilder, change look and feel

im coding a program using windowbuilder in eclipse. I would like to have help with changing the design (Look and feel) from metal to windows. How would i do that? thank you

like image 561
redpois0n Avatar asked Aug 12 '11 20:08

redpois0n


People also ask

Which method is used to change the look and feel of the Java GUI application?

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.


2 Answers

In Eclipse go to

Window > Preferences > WindowBuilder > Swing > LookAndFeel

and tick

Apply choosen LookAndFeel in main() method.

This way whenever you change the look and feel in WindowBuilder's design view, it will be applied in the code.

like image 168
Mohammad Banisaeid Avatar answered Oct 05 '22 13:10

Mohammad Banisaeid


the Swing call is:

try {
  UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch(Exception e) {
  System.out.println("Error setting native LAF: " + e);
}

i recall in swt the window trims will change naturally when you cycle through the themes since the widgets are actually native to the os. are you using Swing or SWT?

like image 23
simgineer Avatar answered Oct 05 '22 13:10

simgineer