Benutzer-Werkzeuge

Webseiten-Werkzeuge


en:gui-usage

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
en:gui-usage [2015/01/02 12:40] – [JMenu] roehneren: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.
 +<html><img src="http://vg08.met.vgwort.de/na/0bcd12449ac147d08ba0529b6daeced2" width="1" height="1" alt=""></html>
 \\ \\
 \\ \\
Zeile 73: Zeile 74:
 ---- ----
  
-==== JRadioButton & JButtonGroup ====+==== ButtonGroup ====
 {{:en:radiobuttonen.png}} {{:en:radiobuttonen.png}}
-JRadiobuttons offer different options, from which you can choose just one. +A Buttongroup groups Radiobuttons or CheckboxesSet the attribute Checkboxes to true if you want a group of CheckboxesEnter your options using the Items attribute. 
-To group the JRadioButtons you have to place an invisible ButtonGroup component {{:en:buttongroup.png}} on the form. +
-Write the name of this ButtonGroup for each JRadioButton as value of the attribute //ButtonGroup// in the object inspector.+
  
-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>  public String buttonGroup1_getSelectedRadioButtonLabel() { ... }</code>+<code java>  public String buttonGroup1_getSelectedButtonGroupLabel() { ... }</code>
  
-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>  if (bgColor_getSelectedRadioButtonLabel().equals("green"))</code>+<code java>  if (bgColor_getSelectedButtonGroupLabel().equals("green"))</code>
 \\ \\
 ---- ----
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 //paint(Graphics g)// method. Such a derived class can be placed in a GUI-form with right-click on the Canvas-Symbol. 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 //paint(Graphics g)// method. Such a derived class can be placed in a GUI-form with right-click on the Canvas-Symbol.
  
- 
-The turtle which belongs to the Java-Editor is an example of a Canvas-subclass.\\ 
 ---- ----
  
 ==== Turtle ==== ==== Turtle ====
 +{{:de:fxturtle.png}}
 +
 +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.
 +
 +{{:de:playgroundturtle.png}}
 +
 +Since Java-Editor version 13.00 the Turtle-component has changed. We now have an animated Turtle-Component based on the Turtle from [[http://www.aplu.ch/home/apluhomex.jsp|Ägidius Plüss]]. The Playground- and a Turtle-component are on the new Utilities-tab. You can place one or more Turtles on a Playground.
 +
 +Due to didactic reduction and technical issues the GUI doesn't react when a Turtle is drawing. 
 +
 {{:de:turtle.png}} {{:de:turtle.png}}
  
-The Turtle-component provides a drawing-area, on which you can draw with turtle-commands. You find them in the documentation of the Turtle-class.+Before Version 13.00 we had another Turtle-component. If you want to use a program with this older Turtle you have to import it like this: <code>import je.util.*;</code>
  
 As a didactic reduction the turtle has a //setOrigin(double x, double y)-method//, with which you can define a coordinatesystem as known from mathematics. As a didactic reduction the turtle has a //setOrigin(double x, double y)-method//, with which you can define a coordinatesystem as known from mathematics.
Zeile 227: Zeile 235:
 {{:de:turtlesetorigin.png}} {{:de:turtlesetorigin.png}}
  
-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 263: Zeile 271:
 \\ \\
 ---- ----
 +==== Timer ====
 +{{:de:timer.png}}
 +
 +With a Timer component, one can control time-dependent processes. Operations can be started and stopped after a predetermined period of time once or periodically.
 +
 +The Timer component uses the class javax.swing.Timer, not the class java.util.Timer.
 +
 +Example:
 +
 +<code java>  timer1.start();
 +  ... do anything
 +  timer1.stop();
 +</code>
 +\\
 +----
 +
 ==== JTable ==== ==== JTable ====
 {{:en:jtableicon.png}} With a jTable-component you display a table. {{:en:jtableicon.png}} With a jTable-component you display a table.
Zeile 276: Zeile 300:
   jTabelle.setValueAt("Anna", i, 0);   jTabelle.setValueAt("Anna", i, 0);
 </code>   </code>  
 +\\
 +----
  
- 
-==== Timer ==== 
-{{:de:timer.png}} 
- 
-With a Timer component, one can control time-dependent processes. Operations can be started and stopped after a predetermined period of time once or periodically. 
- 
-The Timer component uses the class javax.swing.Timer, not the class java.util.Timer. 
- 
-Example: 
- 
-<code java> timer1.start();</code> 
  
en/gui-usage.1420198843.txt.gz · Zuletzt geändert: 2015/01/02 13:40 (Externe Bearbeitung)