-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
41 lines (37 loc) · 1.19 KB
/
Copy pathMain.java
File metadata and controls
41 lines (37 loc) · 1.19 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
package com.example.texteditor;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import java.io.IOException;
import java.util.Objects;
/*
* File: Main.java
* Description: A text editor with style change,
* undo and redo functions using stacks.
* Authors:
* - Pavel Sushkov
* Copyright: (c) 2024 Pavel Sushkov
* License: This file is licensed under the MIT License.
*/
public class Main extends Application {
@Override
public void start(Stage stage) throws IOException {
//Binding java file with fxml
Parent root = FXMLLoader.load(Objects.requireNonNull(getClass().getResource("hello-view.fxml")));
//Creating scene
Scene scene = new Scene(root);
//set Title for stage
stage.setTitle("Text Editor");
//set icon image for app
Image icon = new Image("E:\\Projects\\TextEditor\\src\\main\\java\\com\\example\\texteditor\\icon.png");
stage.getIcons().add(icon);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch();
}
}