Links with Swing : Différence entre versions

De Wiki
Aller à : navigation, rechercher
(Page créée avec « <font color=#556B2F>'''GENIUS'''</font> classes use <font color=#FF8C00>swing</font> classes but are not directly inherited from them: strictly speaking, it is not recomme... »)
 
Ligne 15 : Ligne 15 :
  
 
[[WELCOME_TO_THE_GENIUS_WIKI|Return to the introduction ↑]]  
 
[[WELCOME_TO_THE_GENIUS_WIKI|Return to the introduction ↑]]  
[[Conditional_Display|Go to the next page →]]
+
[[GLayout|Go to the next page →]]

Version du 4 mai 2017 à 15:25

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 [[javadoc>fr/cnes/genius/current/fr/cnes/genius/lowLevel/GPanel.html|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 →