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 17:02] – [JList] roehner | en:gui-usage [2015/01/01 22:46] – [JMenuBar] roehner | ||
---|---|---|---|
Zeile 177: | Zeile 177: | ||
you get the JScrollBar-value and do the scrolling according to it. | you get the JScrollBar-value and do the scrolling according to it. | ||
+ | \\ | ||
+ | ---- | ||
+ | |||
+ | ==== JScrollPane ==== | ||
+ | {{: | ||
+ | |||
+ | A JScrollPane-component provides a horizontal and a vertical JScrollBar-component for a twodimensional scrolling. | ||
+ | |||
+ | The Java-Editor adds to JTextArea, JList, JTable, JTree, JEditorPane und JTextPane-components automatically a JScrollPane-component. | ||
+ | \\ | ||
+ | ---- | ||
+ | |||
+ | ==== JPanel ==== | ||
+ | {{: | ||
+ | |||
+ | JPanel-components are used for structuring of graphical user interfaces. Each JPanel-component is a container which can hold other gui-components. With the object-inspector you can set a border to a JPanel-component. | ||
+ | \\ | ||
+ | ---- | ||
+ | |||
+ | ==== Canvas ==== | ||
+ | {{: | ||
+ | |||
+ | A Canvas-component provides a drawing-area. | ||
+ | |||
+ | To draw on the drawing-area you can get a graphic-context from the Canvas-component. This graphic-context is used as a paint-box with many drawing-possibilities. | ||
+ | |||
+ | You get the graphics-context from your Canvas-component in this way: | ||
+ | |||
+ | <code java> | ||
+ | |||
+ | With the graphics-context you are able to draw e. g. a rectangle: | ||
+ | |||
+ | <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 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 ==== | ||
+ | {{: | ||
+ | |||
+ | The Turtle-component provides a drawing-area, | ||
+ | |||
+ | As a didactic reduction the turtle has a // | ||
+ | |||
+ | Example: | ||
+ | {{: | ||
+ | |||
+ | The Turtle and it's documentation must be installed inside des Java-Editor configuration. | ||
+ | |||
+ | \\ | ||
+ | ---- | ||
+ | |||
+ | ==== 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 // | ||
+ | |||
\\ | \\ | ||
---- | ---- |
en/gui-usage.txt · Zuletzt geändert: 2022/09/02 10:20 von 127.0.0.1