我正在尝试创建一个看起来像这样的简单按钮-
JButton connectBtn = new JButton("Connect");
Color blue = new Color(77,176,230);
connectBtn.setBackground(blue);
但问题是背景蓝色并没有看起来那么暗。
我已经尝试了以下所有可能性,但没有用:-(
connectBtn.setBackground(Color.blue);
connectBtn.setBackground(Color.BLUE.brighter());
connectBtn.setBackground(Color.decode("#0099cc"));//i tried simply #0099cc just to get any dark background
请帮助我将此颜色设置为 JButton 背景。谢谢。