Bonjour à tous,

Débutant avec GWT et Javascript en général, j'essaie de créer une interface assez sommaire, comprenant un TabPanel muni de 3 onglets, chacun comprenant 3 groupes de 7 Checkboxes, et un bouton de confirmation. Mais comment faire ? J'ai déjà rédigé un bout de code, mais je pédale un peu au moment d'integrer des widgets dans des onglets.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package fr.lgm.client;
 
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TabPanel;
import com.google.gwt.user.client.ui.Widget;
 
public class Demo implements EntryPoint {
 
    CheckBox PortALed1 =  new CheckBox(""); //création des checkboxes... Moyen plus simple de les créer ?
    CheckBox PortALed2 =  new CheckBox("");
    CheckBox PortALed3 =  new CheckBox("");
    CheckBox PortALed4 =  new CheckBox("");
    CheckBox PortALed5 =  new CheckBox("");
    CheckBox PortALed6 =  new CheckBox("");
    CheckBox PortALed7 =  new CheckBox("");
 
    CheckBox PortBLed1 =  new CheckBox("");
    CheckBox PortBLed2 =  new CheckBox("");
    CheckBox PortBLed3 =  new CheckBox("");
    CheckBox PortBLed4 =  new CheckBox("");
    CheckBox PortBLed5 =  new CheckBox("");
    CheckBox PortBLed6 =  new CheckBox("");
    CheckBox PortBLed7 =  new CheckBox("");
 
    CheckBox PortCLed1 =  new CheckBox("");
    CheckBox PortCLed2 =  new CheckBox("");
    CheckBox PortCLed3 =  new CheckBox("");
    CheckBox PortCLed4 =  new CheckBox("");
    CheckBox PortCLed5 =  new CheckBox("");
    CheckBox PortCLed6 =  new CheckBox("");
    CheckBox PortCLed7 =  new CheckBox("");
 
    Button w = new Button("Ecriture", new ClickListener() {//création de bouton ecriture
        public void onClick(Widget sender) {
          Window.alert("Eciture en cours");
        }
 
      });
    Button r = new Button("Lecture", new ClickListener() {//création du bouton lecture
        public void onClick(Widget sender) {
          Window.alert("Lecture en cours");
        }
 
      });
 
    TabPanel tp = new TabPanel();
 
  public void onModuleLoad() {
 
	  	tp.insert(w,"Write", 0);//insertion du bouton write dans un premier onglet
	    tp.insert(r,"Read", 1);//insertion du bouton read dans un second onglet
 
	    tp.selectTab(0);
 
	    RootPanel.get().add(tp);
  }
 
}
N'y aurait il pas un moyen plus efficace de déclarer les Checkbox ? Comment les insérer dans un onglet ?

Merci d'avance, et désolé de mon inexpérience !