Changing the background of JButton

前端 未结 3 2030
夕颜
夕颜 2021-01-14 18:36

I have a Swing JButton and I\'m also using the following code for my project:

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-14 18:51

    This depends on what you want to achieve.

    You could use JButton#setContentAreaFilled passing it false, but you, probably also need to call JButton#setBorderPainted passing it falls

    You could also change the UIManager's default value for the buttons background

提交回复
热议问题