JavaFX Tutorial 09 Create ToggleButton Java GUI
Code Source :
@Override
public void start(Stage primaryStage) {
HBox h = new HBox();
ToggleGroup tg = new ToggleGroup();
ToggleButton btn1 = new ToggleButton("ADD");
ToggleButton btn2 = new ToggleButton("EDIT");
ToggleButton btn3 = new ToggleButton("DELETE");
tg.getToggles().addAll(btn1,btn2,btn3);
h.getChildren().addAll(btn1,btn2,btn3);
Scene sc = new Scene(h,600,400);
primaryStage.setScene(sc);
primaryStage.setTitle("Tutorial JavaFX");
primaryStage.show();
}
Libraries importing :
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ToggleButton;
import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
A JavaFX ToggleButton is a button that can be selected or not selected. Like a button that stays in when you press it, and when you press it the next time it comes out again. Toggled - not toggled. The JavaFX ToggleButton is represented by the class javafx.scene.control.ToggleButton .
On this page of the site you can watch the video online JavaFX Tutorial 09 - Create ToggleButton Java GUI with a duration of hours minute second in good quality, which was uploaded by the user Code Amir 01 January 1970, share the link with friends and acquaintances, this video has already been watched 819 times on youtube and it was liked by 10 viewers. Enjoy your viewing!