en:gui-usage
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
en:gui-usage [2015/01/01 22:46] – [JMenuBar] roehner | en:gui-usage [2022/09/02 10:20] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 7: | Zeile 7: | ||
With the method setLocation(int x, int y) of a JLabel-component you can animate an image. | With the method setLocation(int x, int y) of a JLabel-component you can animate an image. | ||
+ | < | ||
\\ | \\ | ||
\\ | \\ | ||
Zeile 73: | Zeile 74: | ||
---- | ---- | ||
- | ==== JRadioButton & JButtonGroup | + | ==== ButtonGroup |
{{: | {{: | ||
- | JRadiobuttons 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 the JRadioButtons | + | |
- | Write the name of this ButtonGroup for each JRadioButton as value of the attribute | + | |
- | The Java-Editor places this method into the java source code: | + | For a buttongroup of radiobuttons the Java-Editor places this method into the java source code: |
- | <code java> | + | <code java> |
- | so it's easy to get the selected JRadioButton of a ButtonGroup. Example: | + | so it's easy to get the selected JRadioButton of a Buttongroup. Example: |
- | <code java> | + | <code java> |
\\ | \\ | ||
---- | ---- | ||
Zeile 213: | Zeile 212: | ||
If you minimize your Java-Application with a Canvas-component und show it up again, the content of the Canvas-Component is lost. To avoid this, you have to create a subclass from Canvas and do the drawing in the // | If you minimize your Java-Application with a Canvas-component und show it up again, the content of the Canvas-Component is lost. To avoid this, you have to create a subclass from Canvas and do the drawing in the // | ||
- | |||
- | The turtle which belongs to the Java-Editor is an example of a Canvas-subclass.\\ | ||
---- | ---- | ||
==== Turtle ==== | ==== Turtle ==== | ||
+ | {{: | ||
+ | |||
+ | Since Java-Editor version 14.04 we have an animated Turtle-component for JavaFX. | ||
+ | It's conception is based on the former Turtle-component and supports a cartesian coordinate system. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Since Java-Editor version 13.00 the Turtle-component has changed. We now have an animated Turtle-Component based on the Turtle from [[http:// | ||
+ | |||
+ | Due to didactic reduction and technical issues the GUI doesn' | ||
+ | |||
{{: | {{: | ||
- | The Turtle-component | + | Before Version 13.00 we had another |
As a didactic reduction the turtle has a // | As a didactic reduction the turtle has a // | ||
Zeile 227: | Zeile 235: | ||
{{: | {{: | ||
- | The Turtle and it's documentation must be installed inside des Java-Editor configuration. | + | Since V13.00 the //setOrigin-method// is a method of the playground. |
\\ | \\ | ||
Zeile 243: | Zeile 251: | ||
{{: | {{: | ||
- | With a JMenu-component you create a menu for a menu bar. In the object-inspector you specify the desired menu bar at the //MenuBar// attribute, the menu commands (e. g. New, Open, Save, Print, Exit) at the // | + | With a JMenu-component you create a menu for a menu bar. In the object-inspector you specify the desired menu bar at the //MenuBar// attribute, the menu commands (e. g. New, Open, Save, Print, Exit) at the // |
+ | |||
+ | For each menu command the Java-Editor creates a corresponding event method. | ||
\\ | \\ | ||
---- | ---- | ||
- | ==== JTable ==== | ||
- | {{: | ||
- | Set the number of columns and rows with the attributes // | + | ==== JPopupMenu ==== |
+ | {{: | ||
- | With the method // | + | With a JPopupMenu-component |
- | Example: " | + | {{:en: |
- | <code java> | + | In the object inspector you input at the attribute // |
- | int i = jTabelle.getSelectedRow(); | + | |
- | jTabelle.setValueAt(" | + | |
- | </code> | + | |
+ | For each menu command the Java-Editor creates a corresponding event method. | ||
+ | \\ | ||
+ | ---- | ||
==== Timer ==== | ==== Timer ==== | ||
{{: | {{: | ||
Zeile 271: | Zeile 280: | ||
Example: | Example: | ||
- | <code java> timer1.start();</ | + | <code java> |
+ | ... do anything | ||
+ | timer1.stop(); | ||
+ | </ | ||
+ | \\ | ||
+ | ---- | ||
+ | |||
+ | ==== JTable ==== | ||
+ | {{: | ||
+ | |||
+ | Set the number of columns and rows with the attributes // | ||
+ | |||
+ | With the method // | ||
+ | |||
+ | Example: " | ||
+ | |||
+ | <code java> | ||
+ | int i = jTabelle.getSelectedRow(); | ||
+ | jTabelle.setValueAt(" | ||
+ | </ | ||
+ | \\ | ||
+ | ---- | ||
en/gui-usage.1420148809.txt.gz · Zuletzt geändert: 2015/01/01 23:46 (Externe Bearbeitung)