Java的UI设计,radionButton控件问题
两段相似的代码,分别使用radioButton控件和checkbox控件
//radioButton控件:
radioButtonWap = new Button(groupApp, SWT.RADIO);
radioButtonWap.setText("无线");
radioButtonWap.addSelectionListener(new radioButtonSelectionListener());
private class radioButtonSelectionListener extends SelectionAdapter {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
System.out.println("测试第一次");
}
}
选中按钮时,console会输出两行"测试第一次"
//checkbox控件
checkBoxAllSelect = new Button(groupTableTip, SWT.CHECK);
checkBoxAllSelect.setText("全选");
checkBoxAllSelect.setLayoutData(gridData30);
checkBoxAllSelect.addSelectionListener(new checkBoxSelectionListener());
private class checkBoxSelectionListener extends SelectionAdapter {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
System.out.println("你好!");
}
}
选中复选框时,console只会输出一行"你好!"
请教大侠们,是什么原因
--------------------编程问答-------------------- 为什么一个执行两次,一个只执行一次?
补充:Java , Java SE