Issue
Normally with Java Swing you can set the background color of a button with:
myJButton.setBackground(Color.RED);
which would cause the button to be red. But on the Mac OS, this method seems to be ignored. The button just stays the default color.
How can the color of a JButton be set on the Mac OS?
Solution
Have you tried setting JButton.setOpaque(true)?
JButton button = new JButton("test");
button.setBackground(Color.RED);
button.setOpaque(true);
Answered By - codethulhu Answer Checked By - David Marino (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.