combo
=
new
Combo(shell, SWT.NONE); combo.setBounds(
38
,
29
,
125
,
20
);
final
Button button
=
new
Button(shell, SWT.NONE); button.addSelectionListener(
new
SelectionAdapter()
...
{ public void widgetSelected(SelectionEvent e) ...{ combo.removeAll(); for (int i=0;i<=9;i++) ...{ combo.add("第"+i+"个字符串"); combo.select(0); } } }
); button.setText(
"
设置
"
); button.setBounds(
38
,
101
,
48
,
22
);
final
Button button_1
=
new
Button(shell, SWT.NONE); button_1.addSelectionListener(
new
SelectionAdapter()
...
{ public void widgetSelected(SelectionEvent e) ...{ MessageDialog.openInformation(shell, null, combo.getText()); } }
); button_1.setText(
"
取值
"
); button_1.setBounds(
142
,
101
,
48
,
22
);
转载请注明原文地址: https://ibbs.8miu.com/read-27185.html