Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Setting background color for a JButton

843805Jan 9 2006 — edited Jan 10 2006
My java applet includes a dialog where some JButtons have specified colors. The code I have is basically as follows:
JButton button = new JButton();
button.setBackgroundColor(Color.red);
This works fine with some JRE versions, but JRE 1.4.2-06 displays a thin border in red, and the body of the button is white (or perhaps a light gray color). Any ideas on how to make the whole button red?

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 7 2006
Added on Jan 9 2006
2 comments
1,797 views