« Icons » : différence entre les versions
Aller à la navigation
Aller à la recherche
Aucun résumé des modifications |
Aucun résumé des modifications |
||
(Une version intermédiaire par le même utilisateur non affichée) | |||
Ligne 20 : | Ligne 20 : | ||
* WARNING | * WARNING | ||
[[File:Icons.jpg]] | |||
[[File:Icons.jpg] | |||
<syntaxhighlight lang="java"> | <syntaxhighlight lang="java"> |
Dernière version du 5 mai 2017 à 11:49
GENIUS also allows to get icons instead of buttons with label:
- It can be done using the GButton class with a specific constructor taking a GIcon object as an argument
- It also applies to GExecButton
GENIUS proposes standard icons (included into the genius.jar file) via the GIcon class. The following icons are available:
- CLEAR
- COLLAPSE
- DELETE
- ERROR
- EXIT
- EXPAND
- INFO
- OPEN
- SAVE
- START
- STOP
- WARNING
butLoad = new GButton("Load", new GIcon (GIcon.Type.OPEN, 24)); // Size = 24 pixels
butWrite = new GButton("Write", new GIcon (GIcon. Type.SAVE, 24));
butClear = new GButton("Clear", new GIcon (GIcon. Type.CLEAR, 24));
butQuit = new GButton("Quit", new GIcon (GIcon. Type.EXIT, 24));
cmd = new GJavaCommandLauncher( … );
// Icons change automatically when launch/stop
cmd.setButtonIcons(new GIcon(GIcon.Type.START, 24), new GIcon(GIcon.Type.STOP, 24));
// Specific icon
butAppli = new GButton("Appli", String absoluteOrRelativePath);