-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrimaFinestra.java
More file actions
65 lines (37 loc) · 1.41 KB
/
Copy pathPrimaFinestra.java
File metadata and controls
65 lines (37 loc) · 1.41 KB
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
package application;
import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.layout.GridPane;
import javafx.scene.text.Text;
import javafx.stage.Stage;
public class PrimaFinestra extends Application {
@Override
public void start(Stage stage) throws Exception {
//creating label email
Text text1 = new Text("Hello world");
Text text2 = new Text("Benvenuti al corso");
//Creating a Grid Pane
GridPane gridPane = new GridPane();
//Setting the Grid alignment
gridPane.setAlignment(Pos.CENTER);
gridPane.add(text1, 0, 0);
gridPane.add(text2, 0, 1);
//Creating a scene object
Scene scene = new Scene(gridPane);
//Setting title to the Stage
stage.setTitle("Prima finestra");
//Setting size for the pane
gridPane.setMinSize(400, 200);
// Caricare e applicare il file CSS
String css = this.getClass().getResource("application.css").toExternalForm();
scene.getStylesheets().add(css);
//Adding scene to the stage
stage.setScene(scene);
//Displaying the conten
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}