Links with Swing

De GENIUS
Révision datée du 5 mai 2017 à 08:05 par Admin (discussion | contributions)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)
Aller à la navigation Aller à la recherche

GENIUS classes use swing classes but are not directly inherited from them: strictly speaking, it is not recommended to directly use swing classes. For example, it will be recommanded to use GPanel rather than JPanel because, in that case, the « display » mechanism will not be effective.

Moreover, for certain methods, an over layer is proposed by GENIUS. For example, setEnabled(true/false) method is applicable for a GButton object.

But, in order not to be blocked, one can have direct calls to swing methods:

  • By a call to the swing object included in the **GENIUS** one as for example, with the getJButton() method which refer to the swing JButton object using by GButton;
GButton but = new GButton("button");
but.getJButton().setForeground(Color.BLUE);
  • By a call to swing widgets which do not need GENIUS mechanism as JOptionPane or JFileChooser.

Return to the introduction ↑ Go to the next page →