问题
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!");
}
回答1:
Per my bug report, this issue is fixed in Eclipse 2019-09
来源:https://stackoverflow.com/questions/56213920/widgetselected-and-different-os-platform-behaviors