public static void main(String[] args) throws Exception{
Display display=new Display();
Shell shell=new Shell(display,SWT.SHELL_TRIM);
RowLayout layout=new RowLayout(SWT.VERTICAL);
shell.setLayout(layout);
shell.setText("下拉框和按钮");
Button checkbox=new Button(shell,SWT.CHECK);
checkbox.setText("SWT.CHECK");
Combo radio=new Combo(shell,SWT.ABORT);
radio.add("SWT 12");
radio.add("S");
radio.add("123");
shell.pack();
shell.open();
while(!shell.isDisposed()){
if(!display.readAndDispatch()){
display.sleep();
}
}
display.dispose();
}
转载:https://blog.csdn.net/jayliu/article/details/373596