|
@@ -101,9 +101,9 @@ public class SettingsWindow extends JDialog {
|
|
|
|
|
|
// Create text field
|
|
// Create text field
|
|
JTextField textField = createTextField(Integer.toString(value));
|
|
JTextField textField = createTextField(Integer.toString(value));
|
|
- textField.addActionListener((e) -> {
|
|
|
|
|
|
+ textField.getDocument().addDocumentListener((SimpleDocumentListener)(e) -> {
|
|
if (listener != null) {
|
|
if (listener != null) {
|
|
- String text = ((JTextField) e.getSource()).getText();
|
|
|
|
|
|
+ String text = textField.getText();
|
|
try {
|
|
try {
|
|
listener.accept(Integer.parseInt(text));
|
|
listener.accept(Integer.parseInt(text));
|
|
}
|
|
}
|
|
@@ -125,9 +125,9 @@ public class SettingsWindow extends JDialog {
|
|
|
|
|
|
// Create text field
|
|
// Create text field
|
|
JTextField textField = createTextField(Double.toString(value));
|
|
JTextField textField = createTextField(Double.toString(value));
|
|
- textField.addActionListener((e) -> {
|
|
|
|
|
|
+ textField.getDocument().addDocumentListener((SimpleDocumentListener)(e) -> {
|
|
if (listener != null) {
|
|
if (listener != null) {
|
|
- String text = ((JTextField) e.getSource()).getText();
|
|
|
|
|
|
+ String text = textField.getText();
|
|
try {
|
|
try {
|
|
listener.accept(Double.parseDouble(text));
|
|
listener.accept(Double.parseDouble(text));
|
|
}
|
|
}
|