« GTabbedPane » : différence entre les versions

De GENIUS
Aller à la navigation Aller à la recherche
(Page créée avec « TBW ... Return to the introduction ↑ Go to the next page → »)
 
Aucun résumé des modifications
Ligne 1 : Ligne 1 :
TBW ...
<fc #556B2F>'''GENIUS'''</fc> allows of course to display data inside tabbed panes via the [{{PathCurrentJavaDoc}}/fr/cnes/genius/lowLevel/GTabbedPane.html GTabbedPane] class:
 
<syntaxhighlight lang="java">
GTabbedPane tabs = new GTabbedPane();
 
GLabel lab1 = new GLabel("Tab 1 ..."); // Label to be set in the first pane (rank #0)
GLabel lab2 = new GLabel("Tab 2 ..."); // Label to be set in the second pane (rank #1)
GLabel lab3 = new GLabel("Tab 3 ..."); // Label to be set in the third pane (rank #2)
 
tabs.addTab("Tab 1", new GPanel() {
  public void display() throws GException { generic(); }
  public void generic() throws GException { put(lab1); }
  });
tabs.addTab("Tab 2", new GPanel() {
  public void display() throws GException { generic(); }
  public void generic() throws GException { put(lab2); }
  });
tabs.addTab("Tab 3", new GPanel() {
  public void display() throws GException { generic(); }
  public void generic() throws GException { put(lab2); }
  });
 
tabs.getJTabbedPane().setSelectedIndex(1); // The pane to be displayed first will be the #1 one.
tabs.getJTabbedPane().setEnabledAt(0, false); // The pane #0 will not be modifiable
public void display() throws GException { put(tabs); }
</syntaxhighlight>
 
[[File:TabbedPane.jpg]]
 


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

Version du 5 mai 2017 à 13:02

<fc #556B2F>GENIUS</fc> allows of course to display data inside tabbed panes via the GTabbedPane class:

GTabbedPane tabs = new GTabbedPane();

GLabel lab1 = new GLabel("Tab 1 ..."); // Label to be set in the first pane (rank #0)
GLabel lab2 = new GLabel("Tab 2 ..."); // Label to be set in the second pane (rank #1)
GLabel lab3 = new GLabel("Tab 3 ..."); // Label to be set in the third pane (rank #2)

tabs.addTab("Tab 1", new GPanel() {
   public void display() throws GException { generic(); }
   public void generic() throws GException { put(lab1); }
   });
tabs.addTab("Tab 2", new GPanel() {
   public void display() throws GException { generic(); }
   public void generic() throws GException { put(lab2); }
   });
tabs.addTab("Tab 3", new GPanel() {
   public void display() throws GException { generic(); }
   public void generic() throws GException { put(lab2); }
   });

tabs.getJTabbedPane().setSelectedIndex(1); // The pane to be displayed first will be the #1 one.
tabs.getJTabbedPane().setEnabledAt(0, false); // The pane #0 will not be modifiable

public void display() throws GException { put(tabs); }

TabbedPane.jpg


Return to the introduction ↑ Go to the next page →