I use this myButton.setBackground(myColor)
to change the JButton
background color to my color, how to find it's original default background color so I can change it back? I know I can save its default background color before I change and use that, but I wonder if Java stores it somewhere so that maybe I can call something like: myButton.getClass.getDefaultBackground()
to get it back ?
相关问题
- DBGrid - How to set an individual background color
- Unable to get column index with table.getColumn me
- How to change default background color for TChromi
- C# How do I create code to set a form back to defa
- Stop location updates when app terminate
相关文章
- Emacs/xterm color annoyance on Linux
- matplotlib bwr-colormap, always centered on zero
- MeshLab: How to import XYZRGB file
- Are default parameters bad practice in OOP?
- “Un-rollover” a JButton when a JOptionPane is disp
- ChartJS. Change axis line color
- Listview background is grey on Droid 3
- set foreground color in FrameLayout in android pro
if you wont get RGB color button try this code
btn.setBackground(new JButton().getBackground());
how about this... it will get the default color of button
now the default background color is stored in the Color jbb which you can now use as the color you want to find/use
changes it back to the default color.
This might help:
http://java.sun.com/j2se/1.5.0/docs/api/java/awt/SystemColor.html
It works both with:
and
(when you create a new JButton, its background color is initialized as a null color)
So, choose the one you consider to be the best for your project