From 304c4f9bbd99d762b1551df3976734885e5509d0 Mon Sep 17 00:00:00 2001 From: Dominik Gruntz Date: Sun, 29 Jul 2018 23:01:42 +0200 Subject: [PATCH] Sets initial value according to initial label If the appliation is started, then the checkbox displays the text "I'm undecided", although the checkbox is deselected. So either the initial text should be changed to "I disagree" or (what this commit does) the initial state should be changed to indeterminate. --- .../controls-checkbox/src/main/java/de/javafxbuch/MainApp.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Kapitel 4/4.2.3/controls-checkbox/src/main/java/de/javafxbuch/MainApp.java b/Kapitel 4/4.2.3/controls-checkbox/src/main/java/de/javafxbuch/MainApp.java index 486b349..ac8284a 100644 --- a/Kapitel 4/4.2.3/controls-checkbox/src/main/java/de/javafxbuch/MainApp.java +++ b/Kapitel 4/4.2.3/controls-checkbox/src/main/java/de/javafxbuch/MainApp.java @@ -17,6 +17,7 @@ public void start(Stage primaryStage) { CheckBox checkBox = new CheckBox("I'm undecided"); checkBox.setAllowIndeterminate(true); + checkBox.setIndeterminate(false); checkBox.setOnAction(e -> { if (checkBox.isIndeterminate()) { checkBox.setText("I'm undecided");