我试图创建一个简单的按钮,看起来应该像这个 -如何为JButton设置“非常深蓝色”的背景色?
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感谢
Printscreen - > Paint - > Colorpicker告诉我按钮的颜色是'1691d9'(或'22,145,217'),如果有帮助的话。 – Keppil
@Keppil AFAIU - 这实际上是'答案',尽管我不同意OP在图像中是'非常深蓝'。 –