Create RadioButton in JavaFX
________________________________________________
package application;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.CheckBox;
import javafx.scene.control.RadioButton;
import javafx.scene.layout.FlowPane;
import javafx.stage.Stage;
public class JavaFXRadioButton extends Application{
@Override
public void start(Stage pStage) {
FlowPane pane = new FlowPane();
RadioButton rbtn1 = new RadioButton("Select1");
RadioButton rbtn2 = new RadioButton("Select2");
CheckBox cbox = new CheckBox("Select3");
CheckBox cbox2 = new CheckBox("Select4");
pane.getChildren().addAll(rbtn1, rbtn2, cbox, cbox2);
Scene scene = new Scene(pane, 250, 250);
pStage.setTitle("JavaFX RadioButton");
pStage.setScene(scene);
pStage.show();
}
public static void main(String[] args) {
Application.launch(args);
}
}
_____________________________________________
Dark Hers
YouTube
https://instagram.com/darkhers
https://www.facebook.com/darkhers
TikTok
https://www.tiktok.com/@darkhers
https://www.pinterest.co.uk/darkhers
Comments
Post a Comment