• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

How to set Look and Feel ?

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Using Netbeans:

I am trying to get a GUI window to look correct on windows XP at the moment it is using "Metal" as its default window.

I have searched on the internet and found code thats supposed to change it but it doesn't work ?

If you could assist me i would be grateful.

Regards

Gary





 
Sheriff
Posts: 22849
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The look and feel should be set before the GUI is shown. Any changes afterwards are not automatically shown. You can force a reload using SwingUtilities.updateComponentTreeUI though. The Component argument and all of its children are then repainted with the new look and feel.
 
Gary Hill
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rob,

Thanks is now working.. and for any one else that reads this here is the working main code.

Regards


Gary



 
Rob Spoor
Sheriff
Posts: 22849
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Side note: it's a bad idea to "swallow" exceptions like that. What happens if something goes wrong in the creation of your window? You'll be wondering why your application doesn't show, and you won't know why. The least you should do is log the exception (e.g. e.printStackTrace()).
 
Gary Hill
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rob,

Yes thanks for pointing that out.

Regards

Gary
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic