我有一个按钮,看起来像这样: 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