Fix behaviour when typing fast.
This commit is contained in:
parent
dc2d218969
commit
68d6021eb4
1 changed files with 1 additions and 13 deletions
|
@ -26,21 +26,9 @@ public class MainPanel {
|
|||
public MainPanel() {
|
||||
parse = false;
|
||||
inputField.addKeyListener(new KeyAdapter() {
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
parse = e.getKeyCode() == KeyEvent.VK_BACK_SPACE || inputField.getSelectedText() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyReleased(KeyEvent e) {
|
||||
if (parse) {
|
||||
outputField.setText(StringUtils.extractUpperCase(inputField.getText()));
|
||||
} else {
|
||||
char key = e.getKeyChar();
|
||||
if (Character.isUpperCase(key)) {
|
||||
outputField.setText(outputField.getText() + key);
|
||||
}
|
||||
}
|
||||
outputField.setText(StringUtils.extractUpperCase(inputField.getText()));
|
||||
}
|
||||
});
|
||||
copyToClipboardButton.addActionListener(e -> {
|
||||
|
|
Loading…
Reference in a new issue