<!DOCTYPE html>
    <html lang="vi" xmlns="https://www.w3.org/1999/xhtml" prefix="og: https://ogp.me/ns#">
    <head>
<title>Gradle JavaFX Java Desktop Application</title>
<meta name="description" content="Gradle JavaFX Java Desktop Application - Savefile - Tin Tức - https&#x3A;&#x002F;&#x002F;365.io.vn&#x002F;savefile&#x002F;lap-trinh-huong-doi-tuong-oop&#x002F;gradle-javafx-java-desktop-application-35.html">
<meta name="author" content="DATAONLINE.IO.VN">
<meta name="copyright" content="DATAONLINE.IO.VN [support@dataonline.io.vn]">
<meta name="generator" content="NukeViet v4.5">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta property="og:title" content="Gradle JavaFX Java Desktop Application">
<meta property="og:type" content="website">
<meta property="og:description" content="Savefile - Tin Tức - https&#x3A;&#x002F;&#x002F;365.io.vn&#x002F;savefile&#x002F;lap-trinh-huong-doi-tuong-oop&#x002F;gradle-javafx-java-desktop-application-35.html">
<meta property="og:site_name" content="DATAONLINE.IO.VN">
<meta property="og:url" content="https://365.io.vn/savefile/lap-trinh-huong-doi-tuong-oop/gradle-javafx-java-desktop-application-35.html">
<link rel="shortcut icon" href="https://365.io.vn/favicon.ico">
<link rel="canonical" href="https://365.io.vn/savefile/lap-trinh-huong-doi-tuong-oop/gradle-javafx-java-desktop-application-35.html">
<link rel="alternate" href="https://365.io.vn/rss/" title="Tin Tức" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/tong-hop/" title="Tin Tức - Tổng hợp" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/gdpt/" title="Tin Tức - GDPT" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/cac-van-ban/" title="Tin Tức - Các văn bản" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/tieu-hoc/" title="Tin Tức - Tiểu học" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/lop-3/" title="Tin Tức - Lớp 3" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/lop-4/" title="Tin Tức - Lớp 4" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/lop-5/" title="Tin Tức - Lớp 5" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/sgk-tieu-hoc/" title="Tin Tức - SGK Tiểu học" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/tin-hoc-3/" title="Tin Tức - Tin học 3" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/tin-hoc-4/" title="Tin Tức - Tin học 4" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/tin-hoc-5/" title="Tin Tức - Tin học 5" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/thcs/" title="Tin Tức - THCS" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/lop-6-75/" title="Tin Tức - Lớp 6" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/lop-7-75/" title="Tin Tức - Lớp 7" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/lop-8-75/" title="Tin Tức - Lớp 8" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/lop-9-75/" title="Tin Tức - Lớp 9" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/sgk-thcs/" title="Tin Tức - SGK THCS" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/tin-hoc-6/" title="Tin Tức - Tin học 6" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/tin-hoc-7/" title="Tin Tức - Tin học 7" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/tin-hoc-8/" title="Tin Tức - Tin học 8" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/tin-hoc-9/" title="Tin Tức - Tin học 9" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/thpt/" title="Tin Tức - THPT" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/lop-10/" title="Tin Tức - Lớp 10" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/lop-11/" title="Tin Tức - Lớp 11" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/lop-12/" title="Tin Tức - Lớp 12" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/sgk-thpt/" title="Tin Tức - SGK THPT" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/tin-hoc-10/" title="Tin Tức - Tin học 10" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/tin-hoc-11/" title="Tin Tức - Tin học 11" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/tin-hoc-12/" title="Tin Tức - Tin học 12" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/cntt/" title="Tin Tức - CNTT" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/phan-mem-quan-li-va-dieu-hanh/" title="Tin Tức - Phần mềm quản lí và điều hành" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/phan-mem-ung-dung/" title="Tin Tức - Phần mềm ứng dụng" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/ung-dung-ai/" title="Tin Tức - Ứng dụng AI" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/mang-may-tinh/" title="Tin Tức - Mạng máy tính" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/lap-trinh/" title="Tin Tức - Lập trình" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/cau-truc-thi-hsg-va-ts-vao-10/" title="Tin Tức - Cấu trúc thi HSG và TS vào 10" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/tai-lieu-hoc-lap-trinh/" title="Tin Tức - Tài liệu học lập trình" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/phan-mem-lap-trinh/" title="Tin Tức - Phần mềm lập trình" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/lap-trinh-truc-quan/" title="Tin Tức - Lập trình trực quan" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/lap-trinh-huong-thu-tuc-pop/" title="Tin Tức - Lập trình hướng thủ tục &#40;POP&#41;" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/de-thi/" title="Tin Tức - Đề thi" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/de-hsg-tin-hoc-thcs/" title="Tin Tức - Đề HSG Tin học THCS" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/de-tin-hoc-ts-vao-10-thpt-chuyen/" title="Tin Tức - Đề Tin học TS vào 10 THPT chuyên" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/de-tin-hoc-hsg-thpt/" title="Tin Tức - Đề Tin học HSG THPT" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/cham-thi/" title="Tin Tức - Chấm thi" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/themis/" title="Tin Tức - Themis" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/vnoi/" title="Tin Tức - VNOI" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/danh-sach-hoc-sinh/" title="Tin Tức - Danh sách học sinh" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/lap-trinh-huong-doi-tuong-oop/" title="Tin Tức - Lập trình hướng đối tượng &#40;OOP&#41;" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/web-nguon-mo/" title="Tin Tức - Web nguồn mở" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/he-dieu-hanh/" title="Tin Tức - Hệ điều hành" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/microsoft-windows/" title="Tin Tức - Microsoft Windows" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/ho-linux/" title="Tin Tức - Họ Linux" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/may-chu/" title="Tin Tức - Máy chủ" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/co-so-du-lieu/" title="Tin Tức - Cơ sở dữ liệu" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/web-server/" title="Tin Tức - Web Server" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/hosting-domain-vps/" title="Tin Tức - Hosting-domain-VPS" type="application/rss+xml">
<link rel="alternate" href="https://365.io.vn/rss/ban-tin/" title="Tin Tức - Bản tin" type="application/rss+xml">
<link rel="preload" as="style" href="https://365.io.vn/assets/css/font-awesome.min.css" type="text/css">
<link rel="preload" as="style" href="https://365.io.vn/themes/default/css/bootstrap.non-responsive.css" type="text/css">
<link rel="preload" as="style" href="https://365.io.vn/themes/default/css/style.css" type="text/css">
<link rel="preload" as="style" href="https://365.io.vn/themes/default/css/style.non-responsive.css" type="text/css">
<link rel="preload" as="style" href="https://365.io.vn/themes/default/css/news.css" type="text/css">
<link rel="preload" as="style" href="https://365.io.vn/themes/default/css/custom.css" type="text/css">
<link rel="preload" as="script" href="https://365.io.vn/assets/js/jquery/jquery.min.js" type="text/javascript">
<link rel="preload" as="script" href="https://365.io.vn/assets/js/language/vi.js" type="text/javascript">
<link rel="preload" as="script" href="https://365.io.vn/assets/js/DOMPurify/purify3.js" type="text/javascript">
<link rel="preload" as="script" href="https://365.io.vn/assets/js/global.js" type="text/javascript">
<link rel="preload" as="script" href="https://365.io.vn/assets/js/site.js" type="text/javascript">
<link rel="preload" as="script" href="https://365.io.vn/themes/default/js/news.js" type="text/javascript">
<link rel="preload" as="script" href="https://365.io.vn/themes/default/js/main.js" type="text/javascript">
<link rel="preload" as="script" href="https://365.io.vn/themes/default/js/custom.js" type="text/javascript">
<link rel="preload" as="script" href="https://365.io.vn/themes/default/js/bootstrap.min.js" type="text/javascript">
<link rel="stylesheet" href="https://365.io.vn/assets/css/font-awesome.min.css">
<link rel="stylesheet" href="https://365.io.vn/themes/default/css/bootstrap.non-responsive.css">
<link rel="stylesheet" href="https://365.io.vn/themes/default/css/style.css">
<link rel="stylesheet" href="https://365.io.vn/themes/default/css/style.non-responsive.css">
<link rel="StyleSheet" href="https://365.io.vn/themes/default/css/news.css">
<link rel="stylesheet" href="https://365.io.vn/themes/default/css/custom.css">
<style type="text/css">
	body{background: #fff;}
</style>
    </head>
    <body>
<div id="print">
	<div id="hd_print">
		<h2 class="pull-left">DATAONLINE.IO.VN</h2>
		<p class="pull-right"><a title="DATAONLINE.IO.VN" href="https://365.io.vn/">https://365.io.vn</a></p>
	</div>
	<div class="clear"></div>
	<hr />
	<div id="content">
		<h1>Gradle JavaFX Java Desktop Application</h1>
		<ul class="list-inline">
			<li>Thứ hai - 21/03/2022 22:38</li>
			<li class="hidden-print txtrequired"><em class="fa fa-print">&nbsp;</em><a title="In ra" href="javascript:;" onclick="window.print()">In ra</a></li>
			<li class="hidden-print txtrequired"><em class="fa fa-power-off">&nbsp;</em><a title="Đóng cửa sổ này" href="javascript:;" onclick="window.close()">Đóng cửa sổ này</a></li>
		</ul>
		<div class="clear"></div>
		<div id="hometext">
			<span style="font-family:Times New Roman,Times,serif;"><span style="font-size:14pt;">Gradle JavaFX Java Desktop Application.</span></span>
		</div>
				<div class="imghome">
			<img alt="Gradle JavaFX Java Desktop Application" src="https://365.io.vn/uploads/news/netbeans.png" width="460" class="img-thumbnail" />
		</div>
		<div class="clear"></div>
		<div id="bodytext" class="clearfix">
			<span style="font-family:Times New Roman,Times,serif;"><span style="font-size:14pt;">settings.gradle</span></span>
<pre>
<code>rootProject.name = &#039;GradleFX&#039;
include(&#039;app&#039;)
project(&quot;:app&quot;).name = &quot;GradleJavaFX&quot;</code></pre>
<span style="font-family:Times New Roman,Times,serif;"><span style="font-size:14pt;">build.gradle</span></span>

<pre>
<code>plugins {
    // Apply the application plugin to add support for building a CLI application in Java.
    id &#039;application&#039;
    id &#039;org.openjfx.javafxplugin&#039; version &#039;0.0.11&#039;
}
/*java {
    toolchain {
       languageVersion.set(JavaLanguageVersion.of(17))
       vendor = JvmVendorSpec.ADOPTOPENJDK
    }
}*/

repositories {
    // Use Maven Central for resolving dependencies.
    mavenCentral()
}

def currentOS = org.gradle.internal.os.OperatingSystem.current()
def platform
if (currentOS.isWindows()) {
    platform = &#039;win&#039;
}else if (currentOS.isMacOsX()) {
    platform = &#039;mac&#039;
}
else{
    platform = &#039;linux&#039;
}
javafx {     
    version = &quot;18-ea+10&quot;
    modules = &#91;&#039;javafx.controls&#039;&#93;   
}
dependencies {
    // Use JUnit Jupiter for testing.
    // testImplementation &#039;org.junit.jupiter:junit-jupiter:5.7.2&#039;

    // This dependency is used by the application.
    //implementation &#039;com.google.guava:guava:30.1.1-jre&#039;
    runtimeOnly &quot;org.openjfx:javafx-graphics:18-ea+10:${platform}&quot;
    runtimeOnly &quot;org.openjfx:javafx-base:18-ea+10:${platform}&quot;
    runtimeOnly &quot;org.openjfx:javafx-controls:18-ea+10:${platform}&quot;
    runtimeOnly &quot;org.openjfx:javafx-fxml:18-ea+10:${platform}&quot;
    runtimeOnly &quot;org.openjfx:javafx-swing:18-ea+10:${platform}&quot;
    runtimeOnly &quot;org.openjfx:javafx-media:18-ea+10:${platform}&quot;
    runtimeOnly &quot;org.openjfx:javafx-web:18-ea+10:${platform}&quot;
}
mainClassName = &#039;GradleFX.App&#039;
application {
    // Define the main class for the application.
    mainClass = mainClassName
}

jar {     
    manifest {      
        attributes( &#039;Main-Class&#039;: mainClassName)                   
    }
    from {
        duplicatesStrategy = DuplicatesStrategy.INCLUDE
        configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
    }
}

tasks.named(&#039;test&#039;) {
    // Use JUnit Platform for unit tests.
    useJUnitPlatform()
}
</code></pre>
<span style="font-family:Times New Roman,Times,serif;"><span style="font-size:14pt;">UtilAlert</span></span>

<pre>
<code>import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonType;

public class UtilAlert {

    private String Title = &quot;&quot;;
    private String HeaderText = &quot;&quot;;

    /**
     * * * @param Title Alert Title
     */
    public void setTitle(String Title) {
        this.Title = Title;
    }

    /**
     * * * @return Alert Title
     */
    public String getTitle() {
        return this.Title;
    }

    /**
     * * * @param HeaderText Alert HeaderText
     */
    public void seHeaderText(String HeaderText) {
        this.HeaderText = HeaderText;
    }

    /**
     * * * @return Alert HeaderText
     */
    public String getHeaderText() {
        return this.HeaderText;
    }

    /**
     * * * @param Title Alert Title * @param HeaderText Alert HeaderText
     */
    public UtilAlert(String Title, String HeaderText) {
        this.Title = Title;
        this.HeaderText = HeaderText;
    }

    /**
     * *
     */
    public UtilAlert() {
    }

    /**
     * * * @param at AlertType Kiểu hộp thoại * @param string Nội dung trên hộp
     * thoại * @param bts ButtonType Các nút lệnh trên hộp thoại * @return
     */
    public ButtonType showAndWait(AlertType at, String string, ButtonType... bts) {
        Alert alert = new Alert(at, string, bts);
        this.setButtonTypeText(bts, alert);
        alert.setTitle(this.Title);
        alert.setHeaderText(this.HeaderText);
        ButtonType buttonType = alert.showAndWait().get();
        return buttonType;
    }

    /**
     * * * @param at AlertType Kiểu hộp thoại * @param string Nội dung trên hộp
     * thoại * @param bts ButtonType Các nút lệnh trên hộp thoại
     */
    public void Show(AlertType at, String string, ButtonType... bts) {
        Alert alert = new Alert(at, string, bts);
        this.setButtonTypeText(bts, alert);
        alert.setTitle(this.Title);
        alert.setHeaderText(this.HeaderText);
        alert.show();
    }

    private void setButtonTypeText(ButtonType&#91;&#93; bts, Alert alert) {
        for (ButtonType buttonType : bts) {
            if (buttonType == ButtonType.YES) {
                ((Button) alert.getDialogPane().lookupButton(ButtonType.YES)).setText(&quot;_Có&quot;);
                ((Button) alert.getDialogPane().lookupButton(ButtonType.YES)).setMnemonicParsing(true);
            }
            if (buttonType == ButtonType.NO) {
                ((Button) alert.getDialogPane().lookupButton(ButtonType.NO)).setText(&quot;_Không&quot;);
                ((Button) alert.getDialogPane().lookupButton(ButtonType.NO)).setMnemonicParsing(true);
            }
            if (buttonType == ButtonType.CANCEL) {
                ((Button) alert.getDialogPane().lookupButton(ButtonType.CANCEL)).setText(&quot;_Hủy&quot;);
                ((Button) alert.getDialogPane().lookupButton(ButtonType.CANCEL)).setMnemonicParsing(true);
            }
            if (buttonType == ButtonType.OK) {
                ((Button) alert.getDialogPane().lookupButton(ButtonType.OK)).setText(&quot;_OK&quot;);
                ((Button) alert.getDialogPane().lookupButton(ButtonType.OK)).setMnemonicParsing(true);
            }
            if (buttonType == ButtonType.CLOSE) {
                ((Button) alert.getDialogPane().lookupButton(ButtonType.CLOSE)).setText(&quot;Đó_ng&quot;);
                ((Button) alert.getDialogPane().lookupButton(ButtonType.CLOSE)).setMnemonicParsing(true);
            }
            if (buttonType == ButtonType.APPLY) {
                ((Button) alert.getDialogPane().lookupButton(ButtonType.APPLY)).setText(&quot;_Áp dụng&quot;);
                ((Button) alert.getDialogPane().lookupButton(ButtonType.APPLY)).setMnemonicParsing(true);
            }
            if (buttonType == ButtonType.FINISH) {
                ((Button) alert.getDialogPane().lookupButton(ButtonType.FINISH)).setText(&quot;_Kết thúc&quot;);
                ((Button) alert.getDialogPane().lookupButton(ButtonType.FINISH)).setMnemonicParsing(true);
            }
            if (buttonType == ButtonType.PREVIOUS) {
                ((Button) alert.getDialogPane().lookupButton(ButtonType.PREVIOUS)).setText(&quot;T_rước&quot;);
                ((Button) alert.getDialogPane().lookupButton(ButtonType.PREVIOUS)).setMnemonicParsing(true);
            }
            if (buttonType == ButtonType.NEXT) {
                ((Button) alert.getDialogPane().lookupButton(ButtonType.NEXT)).setText(&quot;_Tiếp&quot;);
                ((Button) alert.getDialogPane().lookupButton(ButtonType.NEXT)).setMnemonicParsing(true);
            }
        }
    }
}</code></pre>
<span style="font-family:Times New Roman,Times,serif;"><span style="font-size:14pt;">frmMain</span></span>

<pre>
<code>/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package GradleFX;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;
import javafx.scene.control.Label;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.StackPane;
import javafx.scene.text.Font;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
/**
 *
 * @author admin
 */
public class frmMain extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception {
        UtilAlert abert = new UtilAlert(&quot;Thoát khỏi hệ thống&quot;, &quot;Thoát khỏi hệ thống và đóng tất cả các của sổ&quot;);
        primaryStage.setTitle(&quot;Gradle JavaFX Java Desktop Application&quot;);
        String javaVersion = System.getProperty(&quot;java.version&quot;);
        String javafxVersion = System.getProperty(&quot;javafx.version&quot;);
        Label l = new Label(&quot;Hello, JavaFX &quot; + javafxVersion + &quot;, running on Java &quot; + javaVersion + &quot;.&quot;);
        l.setFont(new Font(&quot;Times New Roman&quot;, 18));

        Scene scene = new Scene(new StackPane(l), 800, 600);
        primaryStage.setScene(scene);
        primaryStage.setMaximized(true);
        primaryStage.centerOnScreen();
        primaryStage.show();

        primaryStage.widthProperty().addListener((obs, oldVal, newVal) -&gt; {
            primaryStage.setMaximized(true);            
        });

        primaryStage.heightProperty().addListener((obs, oldVal, newVal) -&gt; {
            primaryStage.setMaximized(true);            
        });

        primaryStage.setOnCloseRequest(
                (WindowEvent e) -&gt; {
                    ButtonType buttonType = abert.showAndWait(Alert.AlertType.CONFIRMATION, &quot;&quot;, ButtonType.YES, ButtonType.NO);
                    if (buttonType == ButtonType.YES) {
                        primaryStage.close();
                        Platform.exit();
                        System.exit(0);
                    } else {
                        e.consume();
                    }

                }
        );

        primaryStage.addEventHandler(KeyEvent.KEY_PRESSED, ev
                -&gt; {
            if (ev.getCode() == KeyCode.ESCAPE) {
                ButtonType buttonType = abert.showAndWait(Alert.AlertType.CONFIRMATION, &quot;&quot;, ButtonType.YES, ButtonType.NO);
                if (buttonType == ButtonType.YES) {
                    primaryStage.close();
                    Platform.exit();
                    Platform.setImplicitExit(true);
                    System.exit(0);
                } else {
                    ev.consume();
                }
            }
        }
        );
    }

    @Override
    public void init() {

    }

    @Override
    public void stop() {

    }

    public static void main(String&#91;&#93; args) {
        Runtime.getRuntime().addShutdownHook(new Thread(() -&gt; System.out.println(&quot;Shutdown hook&quot;)));
        Application.launch(args);
    }
}
</code></pre>
<span style="font-family:Times New Roman,Times,serif;"><span style="font-size:14pt;">App</span></span>

<pre>
<code class="language-java">/*
 * This Java source file was generated by the Gradle &#039;init&#039; task.
 */
package GradleFX;

public class App {

    public static void main(String&#91;&#93; args) {
        frmMain.main(args);
    }
}
</code></pre>
		</div>
				<div id="author">
						<p>
				<strong>Tác giả:</strong>
				<a href="https://365.io.vn/author/Vang-Van-Quyn/">Vàng Văn Quyn</a>
			</p>
		</div>
				<div class="copyright">
			Chú ý: Việc đăng lại bài viết trên ở website hoặc các phương tiện truyền thông khác mà không ghi rõ nguồn<strong> <a href="https://365.info.vn" target="_blank">https://365.io.vn</a>&nbsp;</strong>là vi phạm bản quyền
		</div>
	</div>
	<div id="footer" class="clearfix">
		<div id="url">
			<strong>URL của bản tin này: </strong><a href="https://365.io.vn/savefile/lap-trinh-huong-doi-tuong-oop/gradle-javafx-java-desktop-application-35.html" title="Gradle JavaFX Java Desktop Application">https://365.io.vn/savefile/lap-trinh-huong-doi-tuong-oop/gradle-javafx-java-desktop-application-35.html</a>

		</div>
		<div class="clear"></div>
		<div class="copyright">
			&copy; DATAONLINE.IO.VN
		</div>
		<div id="contact">
			<a href="mailto:support@dataonline.io.vn">support@dataonline.io.vn</a>
		</div>
	</div>
</div>
        <div class="cookie-notice"><div><button onclick="cookie_notice_hide();">&times;</button>Chúng tôi đang sử dụng cookie để cung cấp cho bạn những trải nghiệm tốt nhất trên trang web này. Bằng cách tiếp tục truy cập, bạn đồng ý với <a href="https://365.io.vn/siteterms/privacy.html">Chính sách thu thập và sử dụng cookie</a> của chúng tôi.</div></div>
        <div id="timeoutsess" class="chromeframe">
            Bạn đã không sử dụng Site, <a onclick="timeoutsesscancel();" href="https://365.io.vn/#">Bấm vào đây để duy trì trạng thái đăng nhập</a>. Thời gian chờ: <span id="secField"> 60 </span> giây
        </div>
        <div id="openidResult" class="nv-alert" style="display:none"></div>
        <div id="openidBt" data-result="" data-redirect=""></div>
<div id="run_cronjobs" style="visibility:hidden;display:none;"><img alt="cron" src="/index.php?second=cronjobs&amp;p=u6TU2e6D" width="1" height="1" /></div>
<script src="https://365.io.vn/assets/js/jquery/jquery.min.js"></script>
<script>var nv_base_siteurl="/",nv_lang_data="vi",nv_lang_interface="vi",nv_name_variable="nv",nv_fc_variable="op",nv_lang_variable="language",nv_module_name="news",nv_func_name="savefile",nv_is_user=0, nv_my_ofs=-4,nv_my_abbr="EDT",nv_cookie_prefix="nv4",nv_check_pass_mstime=1738000,nv_area_admin=0,nv_safemode=0,theme_responsive=0,nv_recaptcha_ver=2,nv_recaptcha_sitekey="",nv_recaptcha_type="image",XSSsanitize=1;</script>
<script src="https://365.io.vn/assets/js/language/vi.js"></script>
<script src="https://365.io.vn/assets/js/DOMPurify/purify3.js"></script>
<script src="https://365.io.vn/assets/js/global.js"></script>
<script src="https://365.io.vn/assets/js/site.js"></script>
<script src="https://365.io.vn/themes/default/js/news.js"></script>
<script src="https://365.io.vn/themes/default/js/main.js"></script>
<script src="https://365.io.vn/themes/default/js/custom.js"></script>
<script type="application/ld+json">
        {
            "@context": "https://schema.org",
            "@type": "Organization",
            "url": "https://365.io.vn",
            "logo": "https://365.io.vn/assets/images/logo.svg"
        }
        </script>
<script src="https://365.io.vn/themes/default/js/bootstrap.min.js">
        </script>
<script>
    var LIMIT = 600000; // 10 phút

    var startTime = sessionStorage.getItem("redirect_timer");
    if (!startTime) {
        startTime = Date.now();
        sessionStorage.setItem("redirect_timer", startTime);
    } else {
        startTime = parseInt(startTime, 10);
    }

    var elapsed = Date.now() - startTime;
    var remain = LIMIT - elapsed;

    if (remain > 0) {
        setTimeout(function () {
            alert("Hệ thống sẽ chuyển sang trang chấm bài.");
            window.location.replace("https://vnoj.io.vn");
        }, remain);
    } else {
        window.location.replace("https://vnoj.io.vn");
    }
</script>
</body>
</html>