Question: Without running the program analize the code and explain what is going on, then run the *code to check you answer * A. JavaFX *
Without running the program analize the code and explain what is going on, then run the *code to check you answer * A. JavaFX * B. Application * C. Swing * D. AWT * --------------------------------------------------------------------------------------------------------- * int x = 0; @Override public void start(Stage primaryStage) throws Exception { HBox h1 = new HBox(); Button myButton = new Button("Click Here"); TextField input = new TextField(); myButton.setOnAction(e -> { clicker(input); }); BorderPane myPane = new BorderPane(); h1.getChildren().addAll(myButton, input); myPane.setCenter(h1); Scene myScene = new Scene(myPane, 300, 250); primaryStage.setTitle("clicker"); primaryStage.setScene(myScene); primaryStage.show(); } public static void main(String[] args){ launch(args); } public void clicker(TextField input){ x++; if(x == 1){ input.setText("You have clicked " + x + " time"); } else if(x > 1){ input.setText("You have clicked " + x + " times"); } } */ }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
