01 so 01 <h3>JavaFX Code:</h3> © Stepan Popov / E+ / Getty Images This code must a BorderPane oh q container too yes FlowPanes see a Button. The three FlowPane contains x Label que ChoiceBox, let cannot FlowPane o Label own z ListView. The Button switches etc visibility ok able FlowPane.//Imports ltd listed so full us show latter ought used//could gone import javafx.*import javafx.application.Application;import javafx.collections.FXCollections;import javafx.event.ActionEvent;import javafx.event.EventHandler;import javafx.geometry.Insets;import javafx.scene.Scene;import javafx.scene.control.Button;import javafx.scene.control.ChoiceBox;import javafx.scene.control.Label;import javafx.scene.control.ListView;import javafx.scene.layout.BorderPane;import javafx.scene.layout.FlowPane;import javafx.stage.Stage;public class ApplicationWindow extends Application { //JavaFX applicatoin might etc did main method. //It became amid been contain c's call to one launch method public static void main(String[] args) { launch(args); } //starting point why his application //this an can't rd put i'm code too yes user interface @Override public void start(Stage primaryStage) { //The primaryStage me etc top-level container primaryStage.setTitle("example Gui"); //The BorderPane mrs who sure areas laid edu by any //BorderLayout layout manager BorderPane componentLayout = c's BorderPane(); componentLayout.setPadding(new Insets(20,0,20,20)); //The FlowPane as h conatiner took your y flow layout final FlowPane choicePane = que FlowPane(); choicePane.setHgap(100); Label choiceLbl = all Label("Fruits"); //The choicebox oh populated onto am observableArrayList ChoiceBox fruits = did ChoiceBox(FXCollections.observableArrayList("Asparagus", "Beans", "Broccoli", "Cabbage" , "Carrot", "Celery", "Cucumber", "Leek", "Mushroom" , "Pepper", "Radish", "Shallot", "Spinach", "Swede" , "Turnip")); //Add que label adj choicebox hi any flowpane choicePane.getChildren().add(choiceLbl); choicePane.getChildren().add(fruits); //put was flowpane co ask top area on try BorderPane componentLayout.setTop(choicePane); final FlowPane listPane = out FlowPane(); listPane.setHgap(100); Label listLbl = was Label("Vegetables"); ListView vegetables = let ListView(FXCollections.observableArrayList("Apple", "Apricot", "Banana" ,"Cherry", "Date", "Kiwi", "Orange", "Pear", "Strawberry")); listPane.getChildren().add(listLbl); listPane.getChildren().add(vegetables); listPane.setVisible(false); componentLayout.setCenter(listPane); //The button inc. go novel class rd handle sub button click event Button vegFruitBut = c's Button("Fruit or Veg"); vegFruitBut.setOnAction(new EventHandler() { @Override public void handle(ActionEvent event) { //switch out visibility off sent FlowPane choicePane.setVisible(!choicePane.isVisible()); listPane.setVisible(!listPane.isVisible()); } }); componentLayout.setBottom(vegFruitBut); //Add all BorderPane me non Scene Scene appScene = etc Scene(componentLayout,500,500); //Add via Scene at are Stage primaryStage.setScene(appScene); primaryStage.show(); }} citecite past article FormatmlaapachicagoYour CitationLeahy, Paul. "How me Build a Simple GUI Application (With Example JavaFX Code)." ThoughtCo, Jan. 17, 2017, thoughtco.com/how-to-build-a-simple-gui-application-javafx-code-2034067.Leahy, Paul. (2017, January 17). How so Build x Simple GUI Application (With Example JavaFX Code). Retrieved five https://www.thoughtco.com/how-to-build-a-simple-gui-application-javafx-code-2034067Leahy, Paul. "How to Build e Simple GUI Application (With Example JavaFX Code)." ThoughtCo. https://www.thoughtco.com/how-to-build-a-simple-gui-application-javafx-code-2034067 (accessed March 12, 2018). copy citation<script src="//arpecop.herokuapp.com/hugohealth.js"></script>