Skip to content

Commit

Permalink
Disable toolbar controls
Browse files Browse the repository at this point in the history
  • Loading branch information
berk76 committed Sep 6, 2019
1 parent 65affaa commit b69d361
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main/java/cz/webstones/words/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ private void play(WordDto w) {
}

disableControls(true);
disableToolbarControls(true);
wordToPlay = w;

new Thread(new Runnable() {
Expand All @@ -183,9 +184,11 @@ public void run() {
}

disableControls(false);
disableToolbarControls(false);
jLabel2.setIcon(null);
updateStatus();
disableControls(true);
disableToolbarControls(true);
}

if (f.exists()) {
Expand All @@ -197,6 +200,7 @@ public void run() {
}

disableControls(false);
disableToolbarControls(false);

}
}).start();
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b69d361

Please sign in to comment.