-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
40 lines (32 loc) · 1.53 KB
/
Main.java
File metadata and controls
40 lines (32 loc) · 1.53 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
package atChat;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
public class Main extends Application {
public static void main(String[] args) {
Application.launch(args);
}
@Override
public void start(Stage primaryStage) {
try {
FXMLLoader loader = new FXMLLoader(Main.class.getResource("/atChat/resources/fxml/chatMain.fxml"));
AnchorPane mainPane = (AnchorPane) loader.load();
((ChatMain) loader.getController()).prepare(primaryStage);
Scene scene = new Scene(mainPane);
primaryStage.setScene(scene);
primaryStage.getIcons().addAll(new Image("/atChat/resources/images/@Chat_Icon_16_32bit.png"), new Image("/atChat/resources/images/@Chat_Icon_24_32bit.png"), new Image("/atChat/resources/images/@Chat_Icon_32_32bit.png"), new Image("/atChat/resources/images/@Chat_Icon_48_32bit.png"), new Image("/atChat/resources/images/@Chat_Icon_64_32bit.png"));
scene.getStylesheets().clear();
scene.getStylesheets().add(Main.class.getResource("/atChat/resources/fxml/atChatTheme.css").toExternalForm());
primaryStage.setTitle("@Chat");
primaryStage.show();
} catch (Exception e) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, e.getMessage(), e);
System.out.println("Unable to open @Chat:" + System.getProperty("line.separator") + e.getMessage());
}
}
}