Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

look and feel

 
jay kumar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi allll,

i am makin a project usin swings and AWT and i am using WINDOWS XP , but i am havin a problem with the display, all the components , i.e. the checkboxes buttons etc. look like Windows 98 or ne other previous windows version, how should i set it to look like Windows XP components , which are far more beautiful and colourful than the ugly old ones !!!
 
Scott Presley
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure you set the look and feel. The code below will set the look and feel to the native LnF. If your app is running on windows, then the components will look like windows components...




you'll have to wrap the above line in a try catch clause... I can remember what exception is actually thrown..

hope that helps
-SP
 
Pat Hays
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jack,

I believe that your code is not wrong.

The cause is what version of JDK your are using. I think the JDK your are using must be lower than 1.4.2. If you use JDK1.4.2, this problem will disappear.

Cheers.

Pat
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic