en:gui-usage
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende ÜberarbeitungNächste ÜberarbeitungBeide Seiten der Revision | ||
en:gui-usage [2015/01/01 18:22] – [Canvas] roehner | en:gui-usage [2017/04/18 19:58] – [Turtle] roehner | ||
---|---|---|---|
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 211: | Zeile 212: | ||
<code java> | <code java> | ||
- | 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 supclass | + | 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 |
The turtle which belongs to the Java-Editor is an example of a Canvas-subclass.\\ | The turtle which belongs to the Java-Editor is an example of a Canvas-subclass.\\ | ||
---- | ---- | ||
- | ==== JTable ==== | ||
- | {{: | ||
- | Set the number of columns and rows with the attributes // | + | ==== Turtle ==== |
+ | {{: | ||
- | With the method // | + | 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 | ||
- | Example: " | + | {{:de: |
- | <code java> | + | Since Java-Editor version 13.00 the Turtle-component has changed. We now have an animated Turtle-Component based on the Turtle from [[http:// |
- | int i = jTabelle.getSelectedRow(); | + | |
- | jTabelle.setValueAt(" | + | |
- | </code> | + | |
+ | Due to didactic reduction and technical issues the GUI doesn' | ||
+ | {{: | ||
+ | |||
+ | 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: < | ||
+ | |||
+ | As a didactic reduction the turtle has a // | ||
+ | |||
+ | Example: | ||
+ | {{: | ||
+ | |||
+ | Since V13.00 the // | ||
+ | |||
+ | \\ | ||
+ | ---- | ||
+ | |||
+ | ==== JMenuBar ==== | ||
+ | {{: | ||
+ | |||
+ | With a JMenuBar-component you can create a menu bar. The configuration is done via the menus (JMenu-components) | ||
+ | to be displayed in the menu bar. | ||
+ | \\ | ||
+ | ---- | ||
+ | |||
+ | ==== JMenu ==== | ||
+ | {{: | ||
+ | |||
+ | 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. | ||
+ | |||
+ | \\ | ||
+ | ---- | ||
+ | |||
+ | ==== JPopupMenu ==== | ||
+ | {{: | ||
+ | |||
+ | With a JPopupMenu-component you create a popup menu. In the example a canvas component with yellow background reacts on a rightclick and shows the popup menu. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | In the object inspector you input at the attribute // | ||
+ | |||
+ | For each menu command the Java-Editor creates a corresponding event method. | ||
+ | |||
+ | \\ | ||
+ | ---- | ||
==== Timer ==== | ==== Timer ==== | ||
{{: | {{: | ||
Zeile 240: | Zeile 284: | ||
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.txt · Zuletzt geändert: 2022/09/02 10:20 von 127.0.0.1