测试代码: package swt_jface.demo1; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; public class ButtonStyles { public ButtonStyles() { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new GridLayout(5, true)); Button arrowButton = new Button(shell, SWT.ARROW); arrowButton.setText("&Arrow Button"); Button checkButton = new Button(shell, SWT.CHECK); checkButton.setText("&Check Button"); Button pushButton = new Button(shell, SWT.PUSH); pushButton.setText("&Push Button"); Button radioButton = new Button(shell, SWT.RADIO); radioButton.setText("&Radio Button"); Button toggleButton = new Button(shell, SWT.TOGGLE); toggleButton.setText("&Toggle Button"); // shell.pack(); shell.setSize(500, 100); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } public static void main(String[] args) { new ButtonStyles(); } }