2021-08-22
This commit is contained in:
17
fxml/build.gradle.kts
Normal file
17
fxml/build.gradle.kts
Normal file
@@ -0,0 +1,17 @@
|
||||
plugins {
|
||||
id("elex-application")
|
||||
id("org.openjfx.javafxplugin") version "0.0.10"
|
||||
id("org.beryx.jlink") version "2.23.1"
|
||||
}
|
||||
application {
|
||||
mainClass.set("kr.pe.elex.examples.fxml.FxmlApplication")
|
||||
mainModule.set("kr.pe.elex.examples.fxml")
|
||||
}
|
||||
javafx {
|
||||
version = "11.0.2"
|
||||
modules = listOf("javafx.controls", "javafx.fxml")
|
||||
}
|
||||
dependencies {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package kr.pe.elex.examples.fxml;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class FxmlApplication extends Application {
|
||||
public static void main(String... args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws Exception {
|
||||
primaryStage.setTitle("Hello!");
|
||||
primaryStage.setWidth(800);
|
||||
primaryStage.setHeight(600);
|
||||
//GridPane root = new GridPane();
|
||||
Parent root = FXMLLoader.load(Objects.requireNonNull(getClass()
|
||||
.getResource("/fxml/root.fxml")));
|
||||
Scene scene = new Scene(root);
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
}
|
||||
7
fxml/src/main/java/module-info.java
Normal file
7
fxml/src/main/java/module-info.java
Normal file
@@ -0,0 +1,7 @@
|
||||
module javafx.examples.fxml.main {
|
||||
requires javafx.graphics;
|
||||
requires javafx.controls;
|
||||
requires javafx.fxml;
|
||||
|
||||
exports kr.pe.elex.examples.fxml;
|
||||
}
|
||||
34
fxml/src/main/resources/fxml/root.fxml
Normal file
34
fxml/src/main/resources/fxml/root.fxml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.2" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<center>
|
||||
<Button mnemonicParsing="false" text="Button" BorderPane.alignment="CENTER" />
|
||||
</center>
|
||||
<bottom>
|
||||
|
||||
</bottom>
|
||||
<top>
|
||||
<MenuBar BorderPane.alignment="CENTER">
|
||||
<menus>
|
||||
<Menu mnemonicParsing="false" text="File">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="Close" />
|
||||
</items>
|
||||
</Menu>
|
||||
<Menu mnemonicParsing="false" text="Edit">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="Delete" />
|
||||
</items>
|
||||
</Menu>
|
||||
<Menu mnemonicParsing="false" text="Help">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="About" />
|
||||
</items>
|
||||
</Menu>
|
||||
</menus>
|
||||
</MenuBar>
|
||||
</top>
|
||||
</BorderPane>
|
||||
Reference in New Issue
Block a user