File tree Expand file tree Collapse file tree 3 files changed +49
-0
lines changed
Expand file tree Collapse file tree 3 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ package sample ;
2+
3+ import javafx .fxml .Initializable ;
4+ import java .net .URL ;
5+ import java .util .ResourceBundle ;
6+
7+ public class Controller implements Initializable {
8+
9+ @ Override
10+ public void initialize (URL location , ResourceBundle resources ) {
11+ System .out .println ("View is now loaded!" );
12+ }
13+
14+ }
Original file line number Diff line number Diff line change 1+ package sample ;
2+
3+ import javafx .application .Application ;
4+ import javafx .fxml .FXMLLoader ;
5+ import javafx .scene .Parent ;
6+ import javafx .scene .Scene ;
7+ import javafx .stage .Stage ;
8+
9+ public class Main extends Application {
10+
11+ public static void main (String [] args ) {
12+ launch (args );
13+ }
14+
15+ @ Override
16+ public void start (Stage primaryStage ) throws Exception {
17+ Parent root = FXMLLoader .load (getClass ().getResource ("sample.fxml" ));
18+ primaryStage .setTitle ("Hello World" );
19+ primaryStage .setScene (new Scene (root , 300 , 275 ));
20+ primaryStage .show ();
21+ }
22+
23+
24+ }
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <?import javafx .scene.control.*?>
3+ <?import javafx .scene.layout.*?>
4+
5+ <VBox prefHeight =" 400.0" prefWidth =" 600.0" xmlns =" http://javafx.com/javafx/8" xmlns : fx =" http://javafx.com/fxml"
6+ fx : controller =" sample.Controller" >
7+
8+ <Label text =" I love bacon" />
9+ <Button text =" Submit" />
10+
11+ </VBox >
You can’t perform that action at this time.
0 commit comments