en:javafx
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
en:javafx [2018/12/22 13:14] – [Line] roehner | en:javafx [2022/09/02 10:27] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 2: | Zeile 2: | ||
JavaFX is supported as of version 14.0 by the Java-Editor. The development of this new graphical user interface for the Java-Editor took many months. But I think that the work was worth it. You can now work with a contemporary GUI library, which can also be designed with CSS. Creating a GUI interface is made even easier for novice programmers because, by default, the Object-Inspector displays only the most important attributes of GUI components. This makes the GUI components much easier to configure. In addition, graphic basic figures such as circle, rectangle and polygon are now available, which can also be used to design simple GUI applications with graphic objects in the classroom. | JavaFX is supported as of version 14.0 by the Java-Editor. The development of this new graphical user interface for the Java-Editor took many months. But I think that the work was worth it. You can now work with a contemporary GUI library, which can also be designed with CSS. Creating a GUI interface is made even easier for novice programmers because, by default, the Object-Inspector displays only the most important attributes of GUI components. This makes the GUI components much easier to configure. In addition, graphic basic figures such as circle, rectangle and polygon are now available, which can also be used to design simple GUI applications with graphic objects in the classroom. | ||
- | Please note that in the configuration under //Visibility// you can set which tabs are displayed. For JavaFX | + | As of JDK 11 JavaFX is no longer included |
+ | |||
+ | A documentation of JavaFX | ||
{{: | {{: | ||
+ | Please note that in the configuration under // | ||
Gerhard Röhner | Gerhard Röhner | ||
Zeile 30: | Zeile 33: | ||
{{: | {{: | ||
<code java> | <code java> | ||
- | \\ | ||
---- | ---- | ||
- | |||
==== NumberField ==== | ==== NumberField ==== | ||
{{: | {{: | ||
Zeile 46: | Zeile 47: | ||
<code java> | <code java> | ||
nfSum.setDouble(Sum, | nfSum.setDouble(Sum, | ||
- | \\ | ||
---- | ---- | ||
==== TextArea ==== | ==== TextArea ==== | ||
Zeile 59: | Zeile 59: | ||
<code java> | <code java> | ||
taOutput.appendText(" | taOutput.appendText(" | ||
- | \\ | ||
---- | ---- | ||
==== Button ==== | ==== Button ==== | ||
Zeile 83: | Zeile 82: | ||
{{: | {{: | ||
<code java> | <code java> | ||
- | \\ | ||
- | \\ | ||
---- | ---- | ||
- | ==== RadioButton & ToggleGroup | + | ==== Buttongroup |
{{: | {{: | ||
- | 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, | + | For a buttongroup |
- | The name of this ToggleGroup component is specified for each RadioButton in the object inspector at the // | + | |
- | With the help of the ToggleGroup one can determine the selected option: | + | <code java> |
- | + | | |
- | Example: | + | if (rb != null) return rb.getText(); |
- | + | return ""; | |
- | <code java> | + | } </ |
- | String choosen= choosenRadioButton.getText(); </ | + | |
- | \\ | + | so it's easy to get the selected JRadioButton of a Buttongroup: |
+ | <code java> | ||
---- | ---- | ||
==== ListView ==== | ==== ListView ==== | ||
Zeile 123: | Zeile 120: | ||
If the ListView contains numbers, the selected string must be converted into a number: | If the ListView contains numbers, the selected string must be converted into a number: | ||
<code java> | <code java> | ||
- | int Number= Integer.parseInt(s);</ | + | int Number= Integer.parseInt(s);</ |
- | \\ | + | |
---- | ---- | ||
==== ComboBox ==== | ==== ComboBox ==== | ||
Zeile 149: | Zeile 145: | ||
To be able to react automatically to an input or selection in a ComboBox an event method for //action// is created in the object inspector. | To be able to react automatically to an input or selection in a ComboBox an event method for //action// is created in the object inspector. | ||
- | \\ | ||
---- | ---- | ||
==== Spinner ==== | ==== Spinner ==== | ||
Zeile 159: | Zeile 154: | ||
At runtime you can use the // | At runtime you can use the // | ||
<code java> | <code java> | ||
- | \\ | + | |
+ | To react directly to spinner changes, use the // | ||
---- | ---- | ||
==== Canvas ==== | ==== Canvas ==== | ||
Zeile 175: | Zeile 171: | ||
<code java> | <code java> | ||
- | \\ | ||
---- | ---- | ||
==== Turtle ==== | ==== Turtle ==== | ||
Zeile 187: | Zeile 182: | ||
Example: | Example: | ||
{{: | {{: | ||
- | \\ | ||
---- | ---- | ||
==== MenuBar ==== | ==== MenuBar ==== | ||
Zeile 193: | Zeile 187: | ||
With a MenuBar component you can create a menu bar. The menu bar displays the menus (menu components) assigned to it. | With a MenuBar component you can create a menu bar. The menu bar displays the menus (menu components) assigned to it. | ||
- | \\ | ||
---- | ---- | ||
==== ContextMenu ==== | ==== ContextMenu ==== | ||
Zeile 206: | Zeile 199: | ||
{{: | {{: | ||
- | |||
- | \\ | ||
---- | ---- | ||
==== MenuButton ==== | ==== MenuButton ==== | ||
Zeile 213: | Zeile 204: | ||
In the object inspector enter the menu commands under // | In the object inspector enter the menu commands under // | ||
- | |||
- | \\ | ||
---- | ---- | ||
==== SplitMenuButton ==== | ==== SplitMenuButton ==== | ||
Zeile 220: | Zeile 209: | ||
In the object inspector enter the menu commands under // | In the object inspector enter the menu commands under // | ||
- | |||
- | \\ | ||
---- | ---- | ||
=====JavaFX Controls===== | =====JavaFX Controls===== | ||
The control components of JavaFX extend the standard GUI components of JavaFX Base. | The control components of JavaFX extend the standard GUI components of JavaFX Base. | ||
- | |||
- | |||
==== Slider==== | ==== Slider==== | ||
{{: | {{: | ||
Zeile 235: | Zeile 220: | ||
double value = slider1.getValue(); | double value = slider1.getValue(); | ||
</ | </ | ||
- | |||
- | \\ | ||
---- | ---- | ||
==== ProgressBar==== | ==== ProgressBar==== | ||
Zeile 246: | Zeile 229: | ||
progressBar1.setProgress(0.3); | progressBar1.setProgress(0.3); | ||
</ | </ | ||
- | |||
- | \\ | ||
---- | ---- | ||
- | |||
==== ToolBar==== | ==== ToolBar==== | ||
{{: | {{: | ||
Zeile 259: | Zeile 239: | ||
toolBar1.getItems().addAll(bNew, | toolBar1.getItems().addAll(bNew, | ||
</ | </ | ||
- | |||
- | \\ | ||
---- | ---- | ||
==== Separator==== | ==== Separator==== | ||
{{: | {{: | ||
- | \\ | ||
---- | ---- | ||
==== ToggleButton==== | ==== ToggleButton==== | ||
Zeile 272: | Zeile 249: | ||
if (toggleButton1.isSelected()) ... | if (toggleButton1.isSelected()) ... | ||
</ | </ | ||
- | |||
- | \\ | ||
---- | ---- | ||
==== PasswordField==== | ==== PasswordField==== | ||
{{: | {{: | ||
- | |||
- | \\ | ||
---- | ---- | ||
==== ChoiceBox==== | ==== ChoiceBox==== | ||
{{: | {{: | ||
- | |||
- | \\ | ||
---- | ---- | ||
==== Hyperlink==== | ==== Hyperlink==== | ||
{{: | {{: | ||
- | \\ | ||
---- | ---- | ||
==== HTMLEditor==== | ==== HTMLEditor==== | ||
Zeile 297: | Zeile 267: | ||
String s = hTMLEditor1.getHtmlText(); | String s = hTMLEditor1.getHtmlText(); | ||
</ | </ | ||
- | \\ | ||
---- | ---- | ||
==== WebView==== | ==== WebView==== | ||
Zeile 303: | Zeile 272: | ||
A WebView component can display the web page for an internet address. In the //URL// attribute of the object inspector enter the internet address with protocol, e.g. http:// | A WebView component can display the web page for an internet address. In the //URL// attribute of the object inspector enter the internet address with protocol, e.g. http:// | ||
- | |||
- | \\ | ||
---- | ---- | ||
==== ColorPicker==== | ==== ColorPicker==== | ||
Zeile 314: | Zeile 281: | ||
Color c = colorPicker1.getValue(); | Color c = colorPicker1.getValue(); | ||
</ | </ | ||
- | |||
- | \\ | ||
---- | ---- | ||
==== DatePicker==== | ==== DatePicker==== | ||
Zeile 325: | Zeile 290: | ||
LocalDate d = datePicker1.getValue(); | LocalDate d = datePicker1.getValue(); | ||
</ | </ | ||
- | |||
- | \\ | ||
---- | ---- | ||
==== Pagination==== | ==== Pagination==== | ||
{{: | {{: | ||
- | |||
- | \\ | ||
---- | ---- | ||
==== FileChooser==== | ==== FileChooser==== | ||
Zeile 349: | Zeile 310: | ||
File f = fileChooser1_openFile(); | File f = fileChooser1_openFile(); | ||
</ | </ | ||
- | |||
- | \\ | ||
---- | ---- | ||
==== FileChooser==== | ==== FileChooser==== | ||
Zeile 368: | Zeile 327: | ||
File f = fileChooser1_saveFile(); | File f = fileChooser1_saveFile(); | ||
</ | </ | ||
- | |||
- | \\ | ||
==== DirectoryChooser==== | ==== DirectoryChooser==== | ||
{{: | {{: | ||
Zeile 386: | Zeile 343: | ||
File d = directoryChooser1_openDirectory(); | File d = directoryChooser1_openDirectory(); | ||
</ | </ | ||
- | \\ | ||
---- | ---- | ||
==== ImageView==== | ==== ImageView==== | ||
{{: | {{: | ||
- | \\ | ||
---- | ---- | ||
==== MediaView==== | ==== MediaView==== | ||
{{: | {{: | ||
- | \\ | ||
---- | ---- | ||
- | |||
==== TableView==== | ==== TableView==== | ||
{{: | {{: | ||
Zeile 403: | Zeile 356: | ||
The attribute // | The attribute // | ||
- | \\ | ||
---- | ---- | ||
==== TreeTableView==== | ==== TreeTableView==== | ||
{{: | {{: | ||
- | \\ | ||
---- | ---- | ||
=====JavaFX Shapes===== | =====JavaFX Shapes===== | ||
Zeile 423: | Zeile 374: | ||
} | } | ||
</ | </ | ||
- | \\ | ||
---- | ---- | ||
==== Rectangle ==== | ==== Rectangle ==== | ||
{{: | {{: | ||
- | \\ | ||
---- | ---- | ||
==== Ellipse ==== | ==== Ellipse ==== | ||
{{: | {{: | ||
- | \\ | ||
---- | ---- | ||
==== Polygon==== | ==== Polygon==== | ||
{{: | {{: | ||
- | \\ | ||
---- | ---- | ||
==== Arc ==== | ==== Arc ==== | ||
{{: | {{: | ||
- | \\ | ||
---- | ---- | ||
==== Line ==== | ==== Line ==== | ||
{{: | {{: | ||
- | \\ | ||
---- | ---- | ||
==== Text ==== | ==== Text ==== | ||
{{: | {{: | ||
- | \\ | + | ---- |
+ | ==== QuadCurve ==== | ||
+ | {{: | ||
+ | ---- | ||
+ | ==== CubicCurve ==== | ||
+ | {{: | ||
+ | ---- | ||
+ | ==== SVGPath==== | ||
+ | {{: | ||
---- | ---- |
en/javafx.1545480850.txt.gz · Zuletzt geändert: 2018/12/22 13:14 von roehner