This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JButtons in f. Windows XP  Style Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JButtons in f. Windows XP  Style" Watch "JButtons in f. Windows XP  Style" New topic
Author

JButtons in f. Windows XP Style

martin chile
Greenhorn

Joined: Jun 24, 2002
Posts: 21
Hi guys!
I tested my program under Win XP and encountered a problem which I hope u can solve.
There are a few JButtons which are colorized with JButton.setBackground and UIManager.
When Win XP is displayed in Windows-XP-Style (the new and useless Window-look) it overides the setBackground Method/UIManager; but not in the "good old" classic-style.
Especially the backgroundcolor is replaced by the 3D-Button-effect only colored borders are left.
So maybe someone knows how to get around this without losing my beloved buttonbackgroundcolor.
here is some code to try in windows xp.
UIManager.put("Button.background", new Color(157, 0, 0));
UIManager.put("Button.foreground", new Color(255, 255, 255));
UIManager.put("Button.font", sansserifBold11);
jButton2.setBackground(new Color(157, 0, 0));
jButton2.updateUI();
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JButtons in f. Windows XP Style
 
jQuery in Action, 3rd edition