本文介绍了widgetSelected()和不同的OS平台行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有此Java代码,在其中实现了selectionListener
.令人惊讶的是,尽管它在Windows上运行良好,但在Linux(Debian 9.9,Cinnamon)上却无法运行,并且在我调试时,从未到达println
代码.知道为什么它可以在一个平台上(Win?)但不能在另一个平台(Linux)上运行吗?
I have this Java code where I implement a selectionListener
.While it works great on Windows, surprisingly, it doesn't work on Linux (Debian 9.9, Cinnamon) and when I debug, the println
code is never reached.Any idea why it would work on one platform (Win?) but not on another (Linux) ?
DateTime dt = new DateTime(container, SWT.TIME | SWT.MEDIUM | SWT.BORDER);
FormToolkit tk =new FormToolkit(parent.getDisplay());
tk.adapt(dt, true, false);
dt.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
System.out.println("Event caught!");
}
推荐答案
每我的错误报告,此问题已在 Eclipse 2019-09
Per my bug report, this issue is fixed in Eclipse 2019-09
这篇关于widgetSelected()和不同的OS平台行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!