Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » Look and Feel.
Look and Feel. [message #719857] Mon, 29 August 2011 08:41 Go to next message
Andreas  is currently offline Andreas Friend
Messages: 15
Registered: August 2011
Junior Member
Hi guys.

I'm having a slightly annoying issue with the "Look and feel"-settings of WB. Basically, it appears that it doesn't matter what look-and-feel setting I choose when I am in the WB designview - changing it DOES change what I see in the designview, but it does NOT apply when I run the program...

Furthermore, executing "Test/Preview" when I rightclick on a window inside the designview DOES show my GUI with the selected look-and-feel setting. It's just that when I run the application, it defaults to what I think is the "Metal" look-and-feel.

How can I ensure that whichever look-and-feel setting I set will be the one used when the program is executed?

Thanks,
Andreas.
Re: Look and Feel. [message #719878 is a reply to message #719857] Mon, 29 August 2011 09:58 Go to previous messageGo to next message
luca.dragon is currently offline luca.dragonFriend
Messages: 3
Registered: August 2011
Junior Member
for Swing Designer go to Eclipse menu Window->Preferences->WindowBuilder->Swing->LookAndFeel and check "Apply chosen LookAndFeel in main() method" checkbox.
Re: Look and Feel. [message #719885 is a reply to message #719878] Mon, 29 August 2011 10:27 Go to previous messageGo to next message
Andreas  is currently offline Andreas Friend
Messages: 15
Registered: August 2011
Junior Member

Thanks I had that set already, I think the problem why it is not working for me is because I have been manually "deconstructing" and rebuilding my classes. Anyway I made a new class with this option enabled to check what exactly it does, and it is using javax.swing.UIManager.setLookAndFeel() method. However now I have another question...

My application is built mainly after the MVC pattern, however I have a custom "Starter" class that I use to start up instances at the moment, and ran into this problem: calling UIManager.setLookAndFeel() in the "setup" of my GUI-class doesn't work - it DOES work if I set it inside the main-method of my Starter class. Any idea why?

Btw this question obviously is no longer directly tied to WB, more so just the UIManager class, I apologize and hope noone takes offense.

// Andreas
Re: Look and Feel. [message #720002 is a reply to message #719885] Mon, 29 August 2011 16:32 Go to previous message
Eric Clayberg is currently offline Eric ClaybergFriend
Messages: 979
Registered: July 2009
Location: Boston, MA
Senior Member
I don't take offense, but this is probably not the best forum to find answers to questions like that. Someone in a general Swing forum would more likely know the answer (thread related? timing related? I don't know).

As to your earlier question, the expectation is that you will set your LAF once in your app and not in every UI class. Thus, WB does not generate the hardcoded LAF code unless you ask it to via that preference. The LAF drop down in the design window is primarily there to allow you to quickly preview what the UI would look like under different LAFs.
Previous Topic:Help
Next Topic:Freezing the pallet
Goto Forum:
  


Current Time: Thu Apr 25 05:48:01 GMT 2024

Powered by FUDForum. Page generated in 0.03623 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top