commit 76a0e4976671ac1c5322a97f7db69554613faa8e
parent 59c71bbcd2550e20961ac64205d91b14d96734e3
Author: Wim Dupont <wim@wimdupont.com>
Date: Sat, 25 Nov 2023 21:23:10 +0100
disable autoscrolling
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/wimdupont/service/WordTester.java b/src/main/java/com/wimdupont/service/WordTester.java
@@ -19,6 +19,7 @@ import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.KeyStroke;
+import javax.swing.text.DefaultCaret;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
@@ -112,6 +113,7 @@ public class WordTester {
dictionaryPanel.setBackground(new Color(0, 0, 51));
dictionaryPanel.setForeground(new Color(150, 250, 250));
dictionaryPanel.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 15));
+ ((DefaultCaret) dictionaryPanel.getCaret()).setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
var actionMap = new ActionMap();
actionMap.put(PREVIOUS, previous(index, wordField, words, dictionaryPanel));
actionMap.put(SHOW, show(index, words, dictionaryPanel));