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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JButtons in f. Windows XP  Style" Watch "JButtons in f. Windows XP  Style" New topic

JButtons in f. Windows XP Style

martin chile

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));
I agree. Here's the link:
subject: JButtons in f. Windows XP Style
It's not a secret anymore!