| Author |
How to set the color of a button and toolbar ?
|
Avin Sinanan
Ranch Hand
Joined: Nov 07, 2001
Posts: 109
|
|
Hello, I was wondering if anyone out there knows how to set the colour of a JButton and a JToolBar to say.. red . Usually the button and toolbars are grey. I want to change this to give the program a more professional look. any ideas? thanks
|
yours respectfully<br />Avin Sinanan
|
 |
Dirk Schreckmann
Sheriff
Joined: Dec 10, 2001
Posts: 7023
|
|
JButton inherits setBackground(Color) from JComponent. So, this: JButton jbutton = new JButton("JButton"); jbutton.setBackground(Color.red); creates a new JButton and sets its color to red.
|
[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
|
 |
Dirk Schreckmann
Sheriff
Joined: Dec 10, 2001
Posts: 7023
|
|
|
The same goes for JToolBar.
|
 |
 |
|
|
subject: How to set the color of a button and toolbar ?
|
|
|