我試圖創建一個簡單的按鈕,看起來應該像這個 -如何爲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在圖像中是'非常深藍'。 –