javaeclipselook-and-feelwindowbuilder

Eclipse WindowBuilder uses different LookAndFeel than it puts into the main method


So I created a GUI for my program with the WindowBuilder from the Eclipse Marketplace. After I finished designing, i implemented it into my program but on the first start, I noticed how ugly the buttons and slider looked and changed the LookAndFeel variable.

I did some research and got suggested to tick the box in the Eclipse settings for the WindowBuilder implementing the choosen LookAndFeel as displayed in the built in preview. I did so and it sure worked, but for some reason whilst getting this in the preview:

Preview Image in WindowBuilder

I get this when running my program:

Screenshot of the program running

I have no idea why this is happening, so I thought I'd ask here.


Solution

  • Well, problem was simple in the end: Because all the components were static and not object owned, the style was different. So if anyone ever encounters this problem: Make the variables for JTextArea, JTextField etc. not static!