/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package comboboxapp1; import com.javafx.preview.control.ComboBox; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.ToggleButton; import javafx.scene.layout.Pane; import javafx.scene.layout.VBox; import javafx.stage.Stage; /** * @author Alexander Kirov */ public class Issue1 extends Application { public static void main(String[] args) { launch(args); } final ComboBox testedComboBox = new ComboBox(); @Override public void start(Stage stage) throws Exception { Pane pane = new Pane(); pane.setPrefHeight(200); pane.setPrefWidth(200); pane.getChildren().add(testedComboBox); VBox vb = new VBox(); ToggleButton toggleButton = new ToggleButton(); toggleButton.selectedProperty().bindBidirectional(testedComboBox.showingProperty()); vb.getChildren().addAll(pane, toggleButton); Scene scene = new Scene(vb, 400, 400); stage.setScene(scene); stage.show(); } }