Bonjour,

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
 
public class Client {
 
public static void main (String [] args) {
	Display display = new Display ();
	Shell shell = new Shell (display);
 
	final Text text = new Text (shell, SWT.BORDER);
	text.setLayoutData (new RowData (100, SWT.DEFAULT));
 
 
	String s;
 
	Button ok = new Button (shell, SWT.PUSH);
	ok.setText ("calibrate WiFi");
	ok.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent e) {
			s=text.getText();
 
		}
	});
 
	shell.setLayout (new RowLayout ());
	shell.pack ();
	shell.open ();
	while (!shell.isDisposed ()) {
		if (!display.readAndDispatch ()) display.sleep ();
	}
	display.dispose ();
}
}
il y a une erreur puisque s doit etre final
mais s'l est final, il peut pas etre modifié

comment recuperer la valeur du Text