Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaFX ToggleGroup in SceneBuilder

In JavaFX exists the control ToggleGroup. I have installed the SceneBuilder, version:

Product Version
JavaFX Scene Builder 8.0.0

Build Information
Version 8.0.0
Date: 2015-03-25
Java Version: 1.8.0_40-b25, Oracle Corporation

I can't find this control in the SceneBuilder:

screenshot scenebuilder

Can you help me?

Thanks for your help!

like image 887
mrbela Avatar asked Jan 14 '16 14:01

mrbela


People also ask

Is JavaFX a Scene Builder?

Scene Builder is written as a JavaFX application, supported on Windows, Mac OS X and Linux.

How do you toggle a group in Scene Builder?

When you have created a ToggleButton you can select it in SceneBuilder. Then you will find a field on the right side within the inspector named "Toggle Group". Add a name there and SceneBuilder will put the ToggleButton together with all other ToggleButtons which you give the same group name into a ToggleGroup.

What does a ToggleGroup do JavaFX?

You can group JavaFX ToggleButton instances into a ToggleGroup . A ToggleGroup allows at most one ToggleButton to be toggled (pressed) at any time. The ToggleButton instances in a ToggleGroup thus functions similarly to radio buttons.

Can you use JavaFX without Scene Builder?

You don't have to use FXML or SceneBuilder. You can simply create the objects yourself and add them to your Scene/Stage yourself. It's entirely open as to how you implement it. I've implemented a Screen Management library where it handles either FXML or manually created screens.


2 Answers

You can set it in the properties. It is not a visual control, but a grouping.

enter image description here

like image 142
purring pigeon Avatar answered Sep 28 '22 06:09

purring pigeon


The ToggleGroup is not a control. When you have created a ToggleButton you can select it in SceneBuilder. Then you will find a field on the right side within the inspector named "Toggle Group". Add a name there and SceneBuilder will put the ToggleButton together with all other ToggleButtons which you give the same group name into a ToggleGroup. You can inject the toggle group into your controller in the usual way.

like image 31
mipa Avatar answered Sep 28 '22 05:09

mipa