How to Set the Background Color of a JButton on the Mac OS

前端 未结 5 1829
Happy的楠姐
Happy的楠姐 2020-11-30 08:55

Normally with Java Swing you can set the background color of a button with:

myJButton.setBackground(Color.RED);

which would cause the butto

5条回答
  •  伪装坚强ぢ
    2020-11-30 08:58

    Have you tried setting JButton.setOpaque(true)?

    JButton button = new JButton("test");
    button.setBackground(Color.RED);
    button.setOpaque(true);
    

提交回复
热议问题