Icons

De GENIUS
Aller à la navigation Aller à la recherche

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
  • PRINT
  • SAVE
  • START
  • STOP
  • WARNING


Icons.jpg


  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);


Return to the introduction ↑ Go to the next page →