Как указано, я хочу изменить поведение TAB по умолчанию в JTextArea
(так, чтобы оно действовало как JTextField
или аналогичный компонент)
Здесь действие события
private void diagInputKeyPressed(java.awt.event.KeyEvent evt) {
if(evt.KEY_PRESSED == java.awt.event.KeyEvent.VK_TAB) {
actionInput.transferFocus();
}
}
И вот слушатель
diagInput.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
diagInputKeyPressed(evt);
}
});
Я тоже пробовал evt.KEY_TYPED без радости.
Любые идеи?
быстрое редактирование: я также попробовал requestFocus()
вместо transferFocus()