JavaFX Tutorial 10 - CheckBox Java GUI

Published: 01 January 1970
on channel: Code Amir
667
7

JavaFX Tutorial 10 CheckBox Java GUI
Code Source :
@Override
public void start(Stage primaryStage) {
HBox h = new HBox();
CheckBox c1 = new CheckBox("USA");
c1.setSelected(true);
c1.setTextFill(Color.RED);
CheckBox c2 = new CheckBox("CANADA");
c2.setTextFill(Color.BLUE);
CheckBox c3 = new CheckBox("FRANCE");
c3.setTextFill(Color.GREEN);
h.getChildren().addAll(c1,c2,c3);

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.CheckBox;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.stage.Stage;

A JavaFX CheckBox is a button which can be in three different states: Selected, not selected and unknown (indeterminate). The JavaFX CheckBox control is represented by the class javafx.scene.control.CheckBox.


On this page of the site you can watch the video online JavaFX Tutorial 10 - CheckBox 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 667 times on youtube and it was liked by 7 viewers. Enjoy your viewing!