How to set background color of a button in Java GUI?

后端 未结 7 1097
名媛妹妹
名媛妹妹 2020-12-06 00:30

Below is the code which creates 9 buttons in gridlayout form on a specific pannel3. What i want is to make the background of each button black with grey text over it. Can a

7条回答
  •  天涯浪人
    2020-12-06 01:13

    Use the setBackground method to set the background and setForeground to change the colour of your text. Note however, that putting grey text over a black background might make your text a bit tough to read.

提交回复
热议问题