We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e28b173 commit 51ffa4eCopy full SHA for 51ffa4e
1 file changed
src/main/java/com/babai/ssplot/ui/CenteredField.java
@@ -24,9 +24,11 @@ public void setNumeric(boolean numeric) {
24
var keyListener = new KeyAdapter() {
25
public void keyTyped(KeyEvent e) {
26
char c = e.getKeyChar();
27
- if (!Character.isDigit(c) && c != '.' && c != '-' &&
+ if (!Character.isDigit(c) && c != '-' &&
28
!Character.isISOControl(c)) {
29
- e.consume();
+ if ( (c == '.' && getText().contains(".")) || c != '.' ) {
30
+ e.consume();
31
+ }
32
}
33
34
};
0 commit comments