The following code was successfully tested in a development environment running the same JRE version as the Target JDK Platform (JDK 1.6.0.45 32 Bit) on Windows 10 Enterprise 64 Bit.
There are unexpected(?) problems executing the came code in integration environment running another JRE version 1.8_60 32.
The is deployed from integration server using Java Web Start from JRE version 1.8_60 32
The mouse wheel scroll event handler is not called:
// Compiled on JDK 1.6
public class CComboUtils {
public static void disableMouseWheel(final CCombo combo) {
// Executed both on test (jdk 1.6) and integration (jre 1.8)
combo.addListener(SWT.MouseWheel, new Listener() {
public void handleEvent(Event event) {
// Executed on test. NOT executed on integration
System.out.println("CComboUtils.disableMouseWheel::handleEvent");
if (event.count > 0) {
System.out.println("CComboUtils.disableMouseWheel::handleEvent::handleScrollUp");
handleScrollUp(combo, event);
} else if (event.count < 0) {
// Executed on test. NOT executed on integration System.out.println("CComboUtils.disableMouseWheel::handleEvent::handleScrollDown");
handleScrollDown(combo, event);
}
}
});
}
public static void handleScrollUp(CCombo combo, Event event) {
if (combo.isFocusControl()) {
// could be a legitimate key event, let CCombo handle it
return;
}
event.doit = false;
}
public static void handleScrollDown(CCombo combo, Event event) {
if (combo.isFocusControl()) {
// could be a legitimate key event, let CCombo handle it
return;
}
event.doit = false;
}
}
The problem can be reproduced on other machines with the same OS and JRE versions.
How can I localize and solve the problem?
Is the JRE version the problem?
Is this a problem with CCombo?