-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
61 lines (51 loc) · 1.51 KB
/
Main.java
File metadata and controls
61 lines (51 loc) · 1.51 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
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.control.Button;
import javafx.scene.layout.VBox;
import javafx.geometry.Pos;
import javafx.event.EventHandler;
import javafx.event.ActionEvent;
import javafx.fxml.FXMLLoader;
import java.io.IOException;
public class Main extends Application
{
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new
FXMLLoader(Main.class.getResource("./dlmh_home.fxml"));
fxmlLoader.setController(new homeController());
Scene scene = new Scene(fxmlLoader.load());
stage.setTitle("Don't Leave Me Hanging");
stage.setScene(scene);
stage.show();
/*
Label label;
TextField tf;
Button button;
VBox vbox;
Scene scene;
tf = new TextField("Text Field!");
tf.setMaxWidth(200);
label = new Label("Type text and click the button");
button = new Button("Click");
button.setOnAction(new EventHandler<ActionEvent>() {
@Override public void handle(ActionEvent e) {
label.setText(tf.getText());
}
});
vbox = new VBox(label, tf, button);
vbox.setSpacing(20);
vbox.setAlignment(Pos.CENTER);
scene = new Scene(vbox, 300, 200);
primaryStage.setTitle("A Simple Scene!");
primaryStage.setScene(scene);
primaryStage.show();
*/
}
public static void main(String[] args) {
launch(args);
}
}