Upgrade to java 16
This commit is contained in:
29
javafx-template/src/main/java/app/App.java
Normal file
29
javafx-template/src/main/java/app/App.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package groupid;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* JavaFX App
|
||||
*/
|
||||
public class App extends Application {
|
||||
|
||||
private static Scene scene;
|
||||
|
||||
@Override
|
||||
public void start(Stage stage) throws IOException {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(this.getClass().getResource("App.fxml"));
|
||||
Parent parent = fxmlLoader.load();
|
||||
stage.setScene(new Scene(parent));
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch();
|
||||
}
|
||||
}
|
||||
11
javafx-template/src/main/java/app/AppController.java
Normal file
11
javafx-template/src/main/java/app/AppController.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package groupid;
|
||||
|
||||
import java.io.IOException;
|
||||
import javafx.fxml.FXML;
|
||||
|
||||
public class AppController {
|
||||
|
||||
@FXML
|
||||
private void switchToSecondary() throws IOException {
|
||||
}
|
||||
}
|
||||
16
javafx-template/src/main/resources/app/App.fxml
Normal file
16
javafx-template/src/main/resources/app/App.fxml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
|
||||
<VBox alignment="CENTER" spacing="20.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="app.AppController">
|
||||
<children>
|
||||
<Label text="Primary View" />
|
||||
<Button fx:id="primaryButton" text="Switch to Secondary View" onAction="#switchToSecondary"/>
|
||||
</children>
|
||||
<padding>
|
||||
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
|
||||
</padding>
|
||||
</VBox>
|
||||
Reference in New Issue
Block a user