« Links with Swing » : différence entre les versions

De GENIUS
Aller à la navigation Aller à la recherche
Aucun résumé des modifications
Aucun résumé des modifications
 
Ligne 12 : Ligne 12 :
</syntaxhighlight>
</syntaxhighlight>


* By a call to <font color =#FF8C00>swing</font> widgets which do not need <font color =#556B2F>**GENIUS**</font> mechanism as <font color =#FF8C00>JOptionPane</font> or <font color =#FF8C00>JFileChooser</font>.
* By a call to <font color =#FF8C00>swing</font> widgets which do not need <font color =#556B2F>'''GENIUS'''</font> mechanism as <font color =#FF8C00>JOptionPane</font> or <font color =#FF8C00>JFileChooser</font>.


[[WELCOME_TO_THE_GENIUS_WIKI|Return to the introduction ↑]]  
[[WELCOME_TO_THE_GENIUS_WIKI|Return to the introduction ↑]]  
[[GLayout|Go to the next page →]]
[[GLayout|Go to the next page →]]

Dernière version du 5 mai 2017 à 08:05

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 →