Benutzer-Werkzeuge

Webseiten-Werkzeuge


en:javafx

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
en:javafx [2019/04/07 20:30] roehneren:javafx [2022/09/02 10:27] (aktuell) – Externe Bearbeitung 127.0.0.1
Zeile 83: Zeile 83:
 <code java>  if (myCheckBox.isSelected()) ...</code> <code java>  if (myCheckBox.isSelected()) ...</code>
 ---- ----
-==== RadioButton & ToggleGroup ====+==== Buttongroup ====
 {{:en:radiobuttonen.png}} {{:en:radiobuttonen.png}}
-RadioButtons offer different options, from which you can choose just one.\\+A Buttongroup groups Radiobuttons or Checkboxes. Set the attribute Checkboxes to true if you want a group of Checkboxes. Enter your options using the Items attribute
  
-To group RadioButtons, you need to include an invisible ToggleGroup component {{:en:buttongroup.png}} in the form. +For a buttongroup of radiobuttons the Java-Editor places this method into the java source code: 
-The name of this ToggleGroup component is specified for each RadioButton in the object inspector at the //ToggleGroup// attribute.+
  
-With the help of the ToggleGroup one can determine the selected option: +<code java>  public String buttonGroup1TG_getSelectedButtonGroupLabel() { 
- +    RadioButton rb = (RadioButton)buttonGroup1TG.getSelectedToggle(); 
-Example: +    if (rb !null) return rb.getText(); 
- +    return ""; 
-<code java>RadioButton choosenRadioButton = (RadioButton) toggleGroup1.getSelectedToggle();  +  } </code> 
-String choosenchoosenRadioButton.getText(); </code>+   
 +so it's easy to get the selected JRadioButton of a Buttongroup:\\ 
 +<code java>  if (bgColorTG_getSelectedButtonGroupLabel().equals("green"))</code>
 ---- ----
 ==== ListView ==== ==== ListView ====
Zeile 153: Zeile 154:
 At runtime you can use the //getValue()// method to get the current value: At runtime you can use the //getValue()// method to get the current value:
 <code java>  int value= mySpinner.getValue(); </code> <code java>  int value= mySpinner.getValue(); </code>
 +
 +To react directly to spinner changes, use the //mouseClicked// event.
 ---- ----
 ==== Canvas ==== ==== Canvas ====
en/javafx.txt · Zuletzt geändert: 2022/09/02 10:27 von 127.0.0.1