JavaFX 21 Tutorial 6 - RadioButton

Поділитися
Вставка
  • Опубліковано 21 сер 2024
  • In this tutorial, I will show you how to use radio buttons using JavaFX 21 LTS with IntelliJ 2023.2.4 on Windows 11 x64.
    Radio Buttons enable the user to choose a single item from a group of choice.
    To group radio buttons, you need to create an object of ToggleGroup and set a radio button’s toggleGroup property to join the group as follows;
    ToggleGroup tgFruit = new ToggleGroup();
    rbApple.setToggleGroup(tgFruit);
    rbOrange.setToggleGroup(tgFruit);
    rbPear.setToggleGroup(tgFruit);
    In this way, only one radio button can be selected from the same button group for radio buttons.
    Using the Scene Builder, this is a quite simple procedure. In this tutorial, you set the Toggle Group property to “tgFruit” for all three radio buttons.
    Note: I have updated my IntelliJ IDEA to 2023.2.4 on 29 October 2023.
    #JavaFX21 #IntelliJ #RadioButton

КОМЕНТАРІ • 4

  • @amine_fadssi
    @amine_fadssi 7 місяців тому +1

    thanks for the video ♥

    • @Ken-oh5yh
      @Ken-oh5yh  7 місяців тому

      You're welcome 😊

  • @user-yk7ip2rh1m
    @user-yk7ip2rh1m 9 місяців тому

    Can you please make MenuButton Tutorial JavaFX is amazing

    • @Ken-oh5yh
      @Ken-oh5yh  9 місяців тому

      See ua-cam.com/video/eM50t2LWEaY/v-deo.html