Conditional Display : Différence entre versions

De Wiki
Aller à : navigation, rechercher
m (Admin a déplacé la page CONDITIONAL DISPLAY vers Conditional Display)
 
(10 révisions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
Conditional display is simply managed with « if » or « switch » and using the <font color=#4169E1>generic()</font> method (or the <font color=#4169E1>display()</font> method for specific treatments):
+
Conditional display is simply managed with « <font color=#FF8C00>if</font> » or « <font color=#FF8C00>switch</font> » and using the <font color=#4169E1>generic()</font> method (or the <font color=#4169E1>display()</font> method for specific treatments):
 
+
<code java>
+
  
 +
<syntaxhighlight lang="java">
 
public class myPanel extends GPanel {
 
public class myPanel extends GPanel {
  
Ligne 23 : Ligne 22 :
 
     put(cb);
 
     put(cb);
 
   }
 
   }
 
+
</syntaxhighlight>
</code>
+
 
 +
 
 +
[[File:ConditionalDisplay1.jpg]] [[File:ConditionalDisplay2.jpg]]
  
{{:user_manual:conditionaldisplay1.jpg?330|}} {{ :user_manual:conditionaldisplay2.jpg?330|}}
 
  
//[[user_manual:introduction|Return to the introduction ↑]]//\\
+
[[WELCOME_TO_THE_GENIUS_WIKI|Return to the introduction ↑]]  
//[[user_manual:glistener|Go to the next page →]]//
+
[[GListener_interface|Go to the next page →]]

Version actuelle en date du 4 mai 2017 à 15:26

Conditional display is simply managed with « if » or « switch » and using the generic() method (or the display() method for specific treatments):

public class myPanel extends GPanel {
 
  GButton but1;
  GButton but2;
  GButton but3;
  GCheckBox cb;
 
  public myPanel() {
    but1 = new GButton("Bouton 1");
    but2 = new GButton("Bouton 2");
    but3 = new GButton("Bouton 3");
    cb   = new GCheckBox("Display button 3"); 
  }
 
  public void generic() throws GException {
    put(but1);
    put(but2);
    if ( cb.isSelected() ) { put(but3); } // Easy, isn't it ?
    put(cb);
   }


ConditionalDisplay1.jpg ConditionalDisplay2.jpg


Return to the introduction ↑ Go to the next page →