• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Event handling of RadioButton in JavaFX

 
Jeyaganeshan Jeyatharsini
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FXML code part :

<fx:define>
<ToggleGroup fx:id="fromBusOrTrain" />
</fx:define>
<children>
<RadioButton mnemonicParsing="false" text="Bus Stand" textFill="#1D94CB" toggleGroup = "$fromBusOrTrain">
<font>
<Font name="Arial Bold" size="14.0" />
</font>
</RadioButton>
<RadioButton mnemonicParsing="false" prefHeight="38.0" prefWidth="133.0" text="Trailway Station" textFill="#1D94CB" GridPane.rowIndex="1" toggleGroup = "$fromBusOrTrain">
<font>
<Font name="Arial Bold" size="14.0" />
</font>
</RadioButton>
</children>

I need to get selected radiobutton from this group.. How to bind action in FXML? And how to get it in controller (Java) class?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic