Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Set Look and Feel for JButton 1

Status
Not open for further replies.

YerMom

Programmer
Oct 3, 2006
127
US
Hi.

I have an app that is a class that extends JFrame. In the class's constructor, I've set the JFrame look and feel like so:
Code:
String windowsClassName = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
UIManager.setLookAndFeel(windowsClassName);

This code works. However, the JFrame also has some JButtons that do not seem to have acquired the windows look and feel. Specifically, the buttons have a flat appearance with square borders. Are there additional steps I need to take to make the buttons get the windows look and feel? I'm on windows xp.

Thanks much.

 
Thanks, MonnkSnake. I discovered I had some initialization code before I set the look and feel. I moved the setLookAndFeel call so it appears first and now the JFrame looks the way it should.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top