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

后端 未结 7 1088
名媛妹妹
名媛妹妹 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:11

    Changing the background property might not be enough as the component won't look like a button anymore. You might need to re-implement the paint method as in here to get a better result:

    enter image description here

提交回复
热议问题