From b69d36176dcc9f5d3069d8ce5b904ce1241d2505 Mon Sep 17 00:00:00 2001 From: Jaroslav Beran Date: Fri, 6 Sep 2019 09:32:58 +0200 Subject: [PATCH] Disable toolbar controls --- src/main/java/cz/webstones/words/Main.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/cz/webstones/words/Main.java b/src/main/java/cz/webstones/words/Main.java index 9d842c5..6e73126 100644 --- a/src/main/java/cz/webstones/words/Main.java +++ b/src/main/java/cz/webstones/words/Main.java @@ -162,6 +162,7 @@ private void play(WordDto w) { } disableControls(true); + disableToolbarControls(true); wordToPlay = w; new Thread(new Runnable() { @@ -183,9 +184,11 @@ public void run() { } disableControls(false); + disableToolbarControls(false); jLabel2.setIcon(null); updateStatus(); disableControls(true); + disableToolbarControls(true); } if (f.exists()) { @@ -197,6 +200,7 @@ public void run() { } disableControls(false); + disableToolbarControls(false); } }).start(); @@ -307,6 +311,16 @@ private void disableControls(boolean b) { jComboBox1.setEnabled(!b); this.revalidate(); } + + private void disableToolbarControls(boolean b) { + jButton6.setEnabled(!b); + jButton7.setEnabled(!b); + jButton8.setEnabled(!b); + jButton9.setEnabled(!b); + jButton10.setEnabled(!b); + jButton11.setEnabled(!b); + jButton12.setEnabled(!b); + } private void disableGoodWrong(boolean b) { jButton1.setEnabled(!b);