2021-08-15
This commit is contained in:
25
java-fx/build.gradle.kts
Normal file
25
java-fx/build.gradle.kts
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Examples for Java
|
||||
*
|
||||
* Copyright (c) 2021. Elex. All Rights Reserved.
|
||||
* https://www.elex-project.com/
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id("elex-java")
|
||||
id("application")
|
||||
id("org.openjfx.javafxplugin") version "0.0.10"
|
||||
id("org.beryx.jlink") version "2.23.1"
|
||||
}
|
||||
application {
|
||||
mainClass.set("kr.pe.elex.examples.FxmlApplication")
|
||||
mainModule.set("kr.pe.elex.examples")
|
||||
}
|
||||
javafx {
|
||||
version = "11.0.2"
|
||||
modules = listOf("javafx.controls", "javafx.fxml")
|
||||
}
|
||||
dependencies {
|
||||
//implementation("org.openjfx:javafx-controls:11.0.2")
|
||||
//implementation("org.openjfx:javafx-fxml:11.0.2")
|
||||
}
|
||||
20
java-fx/logback.xml
Normal file
20
java-fx/logback.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Examples for Java
|
||||
~
|
||||
~ Copyright (c) 2021. Elex. All Rights Reserved.
|
||||
~ https://www.elex-project.com/
|
||||
-->
|
||||
|
||||
<configuration>
|
||||
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="TRACE">
|
||||
<appender-ref ref="CONSOLE" />
|
||||
</root>
|
||||
</configuration>
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Examples for Java
|
||||
*
|
||||
* Copyright (c) 2021. Elex. All Rights Reserved.
|
||||
* https://www.elex-project.com/
|
||||
*/
|
||||
|
||||
package kr.pe.elex.examples;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
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(getClass().getResource ("/fxml/root.fxml"));
|
||||
Scene scene = new Scene(root);
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
}
|
||||
6
java-fx/src/main/java/module-info.java
Normal file
6
java-fx/src/main/java/module-info.java
Normal file
@@ -0,0 +1,6 @@
|
||||
module kr.pe.elex.examples {
|
||||
requires javafx.graphics;
|
||||
requires javafx.fxml;
|
||||
|
||||
exports kr.pe.elex.examples;
|
||||
}
|
||||
41
java-fx/src/main/resources/fxml/root.fxml
Normal file
41
java-fx/src/main/resources/fxml/root.fxml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<!--
|
||||
~ Examples for Java
|
||||
~
|
||||
~ Copyright (c) 2021. Elex. All Rights Reserved.
|
||||
~ https://www.elex-project.com/
|
||||
-->
|
||||
|
||||
<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