wood burning stoves 2.0*
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
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();
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JButtons in f. Windows XP Style
 
Similar Threads
Calling the repaint() method
question about background colors in jtabbedpane
UIManager bug?
Converting an Application into JApplet
JTabbedPane selected tab color