Prepare JavaFX integration
* Added JavaFX and FXML dependencies to pom.xml and module-info.java * Added Startup Application * Added ChatScene with ChatSceneController
This commit is contained in:
34
src/main/java/envoy/client/ui/Startup.java
Normal file
34
src/main/java/envoy/client/ui/Startup.java
Normal file
@ -0,0 +1,34 @@
|
||||
package envoy.client.ui;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
/**
|
||||
* Project: <strong>envoy-client</strong><br>
|
||||
* File: <strong>Startup.java</strong><br>
|
||||
* Created: <strong>26.03.2020</strong><br>
|
||||
*
|
||||
* @author Kai S. K. Engelbart
|
||||
* @since Envoy Client v0.1-beta
|
||||
*/
|
||||
public final class Startup extends Application {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws Exception {
|
||||
var loader = new FXMLLoader(getClass().getResource("ChatScene.fxml"));
|
||||
var anchorPane = loader.<GridPane>load();
|
||||
|
||||
var chatScene = new Scene(anchorPane);
|
||||
primaryStage.setTitle("Envoy");
|
||||
primaryStage.setScene(chatScene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public static void main(String[] args) { launch(args); }
|
||||
}
|
Reference in New Issue
Block a user