我有一個按鈕,看起來像這樣: SWT按鈕 - 刪除按鈕背景
我想刪除按鈕背景..也就是說,圖像將是該按鈕。 這裏是我的代碼:
Button button = new Button(shell, SWT.NONE);
button.setToolTipText("Email Settings...");
button.setImage(SWTResourceManager.getImage(Settings.class, "settings1616.png"));
button.setBounds(494, 26, 28, 25);
我已經試過..
button.setBackground(null);
button.setBackgroundImage(null);
但它不會刪除任何東西。 謝謝!
這是什麼平臺?在某些平臺上(例如Windows),您不能像這樣更改按鈕背景 - http://stackoverflow.com/q/3312102/2670892 – 2014-11-24 16:27:20
我正在使用Windows。這可能通過Macintosh嗎? – 2014-11-24 16:28:03
或只是使用可點擊的JLabel與ImageIcon – 2014-11-24 16:31:22