Bonjour a tous,
je débute tout juste en GWT et j'ai quelque question:
1. Pourquoi je ne peux pas mettre aligné un élément HTML, un TextBox, et un Button ?
Voici le code que j'utilise:
Avec ce code j'obtiens ceci:
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78 public TextBox repo; public Button afficheRepo; public Tree arborescence; public void onModuleLoad() { VerticalPanel layoutPrinc=new VerticalPanel(); /*****************************************/ /** PARTIE HAUTE **/ /*****************************************/ FlowPanel panHaut=new FlowPanel(); HTML HTMLPubRepo=new HTML("Public repository: "); panHaut.add(HTMLPubRepo); repo=new TextBox(); repo.addKeyUpHandler(new KeyUpHandler() { public void onKeyUp(KeyUpEvent event) { if(event.getNativeKeyCode()==KeyCodes.KEY_ENTER){ //TODO declencher un clic sur le bouton afficheRepo } } }); repo.setPixelSize(500, 25); panHaut.add(repo); afficheRepo=new Button("Affiche repository"); afficheRepo.addClickHandler(new GestionClick(this)); panHaut.add(afficheRepo); layoutPrinc.add(panHaut); /*****************************************/ /** PARTIE GAUCHE **/ /*****************************************/ SplitLayoutPanel gaucheCentre=new SplitLayoutPanel(); TreeItem root = new TreeItem("root"); for(int i=0;i<100;i++) root.addItem("item"+i); arborescence=new Tree(); arborescence.addItem(root); ScrollPanel scroll=new ScrollPanel(); scroll.add(arborescence); gaucheCentre.addWest(scroll, 128); /*****************************************/ /** PARTIE CENTRALE **/ /*****************************************/ gaucheCentre.add(new Label("bblavbsdujfhnds")); layoutPrinc.add(gaucheCentre); /*****************************************/ /** **/ /*****************************************/ RootLayoutPanel rp = RootLayoutPanel.get(); rp.add(layoutPrinc); //RootPanel.get("divMain").add(layoutPrinc); }
Donc comme vous pouvez le voir il n'y a rien qui empêche le HTML et le textBox d’être sur la même ligne.... (il n'y a aucun CSS)
2 .Aussi, il manque le SplitPane (avec le Tree et le Label), pourquoi ne sont t'il pas afficher ????
Si j’insère seulement le SplitPane dans ma page,ils sont bien present sans problème...
Donc avez vous des réponses, des idées pour toutes ces questions ?
Je vous remercie d'avance pour vos lumière![]()
Partager