- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
假设我有两个单选按钮,我想默认选中一个,我想要 SelectionListener
做一些 Action 。
当我尝试明显的方法时,它不起作用:
Button button = new Button(parent, SWT.RADIO) ;
button.setSelection(true) ;
button.addSelectionListener( new SelectionAdapter() {
public void widgetDefaultSelected(SelectionEvent e){
doAction() ;
}
}) ;
doAction()
永远不会触发...
SelectionEvent
对于默认选择永远不会触发?
最佳答案
For example, on some platforms default selection occurs in a List when the user double-clicks an item or types return in a Text. On some platforms, the event occurs when a mouse button or key is pressed. On others, it happens when the mouse or key is released. The exact key or mouse gesture that causes this event is platform specific.
Control
上的依赖于平台的操作s。 AFAIK,
Button
与
SWT.CHECK
不是其中之一。
关于java - widgetDefaultSelected() 方法从未触发?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12197964/
假设我有两个单选按钮,我想默认选中一个,我想要 SelectionListener做一些 Action 。 当我尝试明显的方法时,它不起作用: Button button = new Button(p
例如,我想在用户点击按钮时执行一些操作。我用哪一个?文档似乎没有说得很清楚 更新 快速测试显示触发了 Widget Selected 但没有触发 Default Selected。 在 TasksVi
我无法理解 SWT SelectionListener 中两种方法之间的区别。 javadoc如下: void org.eclipse.swt.events.SelectionListener.wid
我是一名优秀的程序员,十分优秀!