-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelloFX.java
More file actions
32 lines (27 loc) · 975 Bytes
/
HelloFX.java
File metadata and controls
32 lines (27 loc) · 975 Bytes
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
package com.example;
import javafx.application.Application;
import javafx.application.HostServices;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class HelloFX extends Application {
public static HostServices hostServices;
public static HostServices hostServices() {
return hostServices;
}
@Override
public void start(Stage stage) throws Exception {
hostServices = getHostServices();
FXMLLoader loader = new FXMLLoader(getClass().getResource("/com/example/hello-view.fxml"));
Parent root = loader.load();
Scene scene = new Scene(root, 720, 520);
scene.getStylesheets().add(getClass().getResource("/css/style.css").toExternalForm());
stage.setTitle("JavaFX NTFY Chat — mats_notiser");
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}