JButton btn=new JButton("TEST");

btn.setForeground(Color.white);// 设置前景色(文字颜色)
btn.setBackground(new Color(3,23,47));// 设置背景色

注意上述颜色的使用。

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-02
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2021-06-03
  • 2021-10-09
相关资源
相似解决方案