« GTabbedPane » : différence entre les versions

De GENIUS
Aller à la navigation Aller à la recherche
Aucun résumé des modifications
Aucun résumé des modifications
 
Ligne 1 : Ligne 1 :
<fc #556B2F>'''GENIUS'''</fc> allows of course to display data inside tabbed panes via the [{{PathCurrentJavaDoc}}/fr/cnes/genius/lowLevel/GTabbedPane.html GTabbedPane] class:
<font color=#556B2F>'''GENIUS'''</font> allows of course to display data inside tabbed panes via the [{{PathCurrentJavaDoc}}/fr/cnes/genius/lowLevel/GTabbedPane.html GTabbedPane] class:


<syntaxhighlight lang="java">
<syntaxhighlight lang="java">

Dernière version du 5 mai 2017 à 13:03

GENIUS 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 →