Bonjour,
J'utilise JavaFX2 et j'ai voulu afficher une fenétre d'attente pour l'utilisateur pendant qu'un certain traitement s'éxécute. Le probléme est que ma fenétre s'affiche mais sans contenu.
Je vous communique mon code :
Ma fenetre :
La fonction qui appelle la fenetre et l'affiche :
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 public class PreparingTestWindow { /* * The scene Title */ Text title = new Text("Preparing Test Operation"); /* * A layout to host the Text field and the button */ HBox hboxLayout = new HBox(5); /* * The layout of the page */ VBox layout = new VBox(10); /* * The stage of the page */ Stage stage = new Stage(); /** * The Default Constructor : builds the user interface of the page */ public PreparingTestWindow() { /* * Set the style of the text title */ title.setFill(Color.BLUE); /* * Progress Bar to show the preparation of the test */ ProgressBar pb = new ProgressBar(); /* * set the text field and the button in the same line (HBox) */ hboxLayout.getChildren().addAll(pb); /* * Set all UI components in the final page layout */ layout.getChildren().addAll(title,hboxLayout); layout.setPrefWidth(400); layout.setPrefHeight(100); layout.setPadding(new Insets(10, 10, 10, 10)); stage.setScene(new Scene(layout)); stage.setTitle("Chose directory"); } public void open() { stage.show(); } public void close() { stage.close(); } }
Merci pour votre aide
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 public void call() { PreparingTestWindow window = new PreparingTestWindow(); window.open(); StringBuilder sb= null; WebServiceCallManager callManager = new WebServiceCallManager(); try { BusinessLog.logger.log(Level.INFO, " Calling /info web service !!"); System.out.println("appel du web service /info"); sb=callManager.CallInfoWebService(); System.out.println(" fin appel du web service /info"); BusinessLog.logger.log(Level.INFO, " End Calling /info web service !!"); BusinessLog.logger.log(Level.INFO, " Response of /info web service is "+sb.toString()); InfoWebServiceResponseParser infoParser = new InfoWebServiceResponseParser(); Long parameterPages = infoParser.getNumberOfPages(sb); System.out.println("parameter pages extracted = "+parameterPages); GlobalParameters.setPagesParameter(parameterPages); window.close; } catch (Exception e) { e.getMessage(); e.getLocalizedMessage(); e.getClass(); e.getStackTrace(); } }![]()
Partager