From 224230e7d585482f1917024a3fff14a70f3064ab Mon Sep 17 00:00:00 2001 From: Phil Burk Date: Sun, 15 Sep 2019 12:01:39 -0700 Subject: ui: use safeRepaint() To allow workaround for OpenJDK bug. https://github.com/philburk/syntona/issues/13 --- src/com/jsyn/swing/RotaryController.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/jsyn/swing/RotaryController.java b/src/com/jsyn/swing/RotaryController.java index 6cc84f3..c26c37f 100644 --- a/src/com/jsyn/swing/RotaryController.java +++ b/src/com/jsyn/swing/RotaryController.java @@ -69,11 +69,17 @@ public class RotaryController extends JPanel { model.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { - repaint(); + safeRepaint(); } + }); } + // This can be overridden in subclasses to workaround OpenJDK bugs. + public void safeRepaint() { + repaint(); + } + public BoundedRangeModel getModel() { return model; } -- cgit v1.2.3