Details
-
Bug
-
Resolution: Fixed
-
P3
-
8u66, 9
-
x86_64
-
linux
Description
FULL PRODUCT VERSION :
ADDITIONAL OS VERSION INFORMATION :
3.11-2-amd64 #1 SMP Debian 3.11.8-1 (2013-11-13) x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
Im using an ComboBox which has an added KeyPressEventFilter . When the user press enter while the focus is on the combobox, the if (e.getCode() == KeyCode.ENTER) condition should be true and some logic should be executed. Which was working on jdk 1.8_45 but in the newer releases the listener does not react on the key enter(other keys are working).
REGRESSION. Last worked in version 8u45
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
- Declare and initialize a ComboBox
- Add on the editor of the ComboBox an EventFilter for KeyEvent.Key_Pressed( comboBoxSearchResults.getEditor().addEventFilter(KeyEvent.KEY_PRESSED, (KeyEvent e) -> {)
-Focus the ComboBox and press enter
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The logic which is implemented in the EventFilter should be executed
ACTUAL -
The logic will be not executed because the EventFilter does not catch the enter key press
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
ComboBox<SearchResult> comboBoxSearchResults;
comboBoxSearchResults.setItems(searchResults);
comboBoxSearchResults.setConverter(new SearchResultStringConverter(searchResults));
comboBoxSearchResults.getEditor().addEventFilter(KeyEvent.KEY_PRESSED, (KeyEvent e) -> {
if (e.getCode() == KeyCode.ENTER) {
//some logic
}
});
---------- END SOURCE ----------
ADDITIONAL OS VERSION INFORMATION :
3.11-2-amd64 #1 SMP Debian 3.11.8-1 (2013-11-13) x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
Im using an ComboBox which has an added KeyPressEventFilter . When the user press enter while the focus is on the combobox, the if (e.getCode() == KeyCode.ENTER) condition should be true and some logic should be executed. Which was working on jdk 1.8_45 but in the newer releases the listener does not react on the key enter(other keys are working).
REGRESSION. Last worked in version 8u45
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
- Declare and initialize a ComboBox
- Add on the editor of the ComboBox an EventFilter for KeyEvent.Key_Pressed( comboBoxSearchResults.getEditor().addEventFilter(KeyEvent.KEY_PRESSED, (KeyEvent e) -> {)
-Focus the ComboBox and press enter
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The logic which is implemented in the EventFilter should be executed
ACTUAL -
The logic will be not executed because the EventFilter does not catch the enter key press
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
ComboBox<SearchResult> comboBoxSearchResults;
comboBoxSearchResults.setItems(searchResults);
comboBoxSearchResults.setConverter(new SearchResultStringConverter(searchResults));
comboBoxSearchResults.getEditor().addEventFilter(KeyEvent.KEY_PRESSED, (KeyEvent e) -> {
if (e.getCode() == KeyCode.ENTER) {
//some logic
}
});
---------- END SOURCE ----------
Attachments
Issue Links
- relates to
-
JDK-8229914 Regression: eventFilter on TextField in editable ComboBox doesn't receive ENTER
- Open
-
JDK-8231692 Test Infrastructure: enhance KeyEventFirer to inject keyEvents into scene
- Resolved