


{"id":507,"date":"2026-07-24T12:37:59","date_gmt":"2026-07-24T05:37:59","guid":{"rendered":"https:\/\/blog.chaiyakul.com\/?p=507"},"modified":"2026-07-24T12:37:59","modified_gmt":"2026-07-24T05:37:59","slug":"make-app-time-shutdown-java-swing-to-exe-launch4j","status":"publish","type":"post","link":"https:\/\/blog.chaiyakul.com\/index.php\/2026\/07\/24\/make-app-time-shutdown-java-swing-to-exe-launch4j\/","title":{"rendered":"\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e15\u0e31\u0e49\u0e07\u0e40\u0e27\u0e25\u0e32\u0e1b\u0e34\u0e14\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e04\u0e2d\u0e21\u0e1e\u0e34\u0e27\u0e40\u0e15\u0e2d\u0e23\u0e4c\u0e14\u0e49\u0e27\u0e22 Java Swing \u0e41\u0e25\u0e30\u0e41\u0e1b\u0e25\u0e07\u0e40\u0e1b\u0e47\u0e19\u0e44\u0e1f\u0e25\u0e4c EXE \u0e14\u0e49\u0e27\u0e22 Launch4j"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\u0e1a\u0e17\u0e19\u0e33<\/h3>\n\n\n\n<p>Java \u0e40\u0e1b\u0e47\u0e19\u0e20\u0e32\u0e29\u0e32\u0e17\u0e35\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e1e\u0e31\u0e12\u0e19\u0e32\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 Desktop \u0e44\u0e14\u0e49\u0e1c\u0e48\u0e32\u0e19 <strong>Java Swing<\/strong> \u0e0b\u0e36\u0e48\u0e07\u0e40\u0e2b\u0e21\u0e32\u0e30\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e17\u0e35\u0e48\u0e17\u0e33\u0e07\u0e32\u0e19\u0e1a\u0e19\u0e23\u0e30\u0e1a\u0e1a\u0e1b\u0e0f\u0e34\u0e1a\u0e31\u0e15\u0e34\u0e01\u0e32\u0e23 Windows, Linux \u0e41\u0e25\u0e30 macOS<\/p>\n\n\n\n<p>\u0e1a\u0e17\u0e04\u0e27\u0e32\u0e21\u0e19\u0e35\u0e49\u0e08\u0e30\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e15\u0e31\u0e49\u0e07\u0e41\u0e15\u0e48\u0e01\u0e32\u0e23\u0e40\u0e02\u0e35\u0e22\u0e19\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 <strong>TimeComputer.java<\/strong> \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e15\u0e31\u0e49\u0e07\u0e40\u0e27\u0e25\u0e32\u0e1b\u0e34\u0e14\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e04\u0e2d\u0e21\u0e1e\u0e34\u0e27\u0e40\u0e15\u0e2d\u0e23\u0e4c \u0e44\u0e1b\u0e08\u0e19\u0e16\u0e36\u0e07\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e44\u0e1f\u0e25\u0e4c <strong>time-computer.jar<\/strong> \u0e41\u0e25\u0e30\u0e41\u0e1b\u0e25\u0e07\u0e40\u0e1b\u0e47\u0e19 <strong>TimeComputer.exe<\/strong> \u0e14\u0e49\u0e27\u0e22 Launch4j \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e43\u0e2b\u0e49\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e1b\u0e34\u0e14\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e44\u0e14\u0e49\u0e40\u0e2b\u0e21\u0e37\u0e2d\u0e19\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 Windows \u0e17\u0e31\u0e48\u0e27\u0e44\u0e1b<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e04\u0e38\u0e13\u0e2a\u0e21\u0e1a\u0e31\u0e15\u0e34\u0e02\u0e2d\u0e07\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21<\/h3>\n\n\n\n<p>\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e17\u0e33\u0e07\u0e32\u0e19\u0e44\u0e14\u0e49\u0e14\u0e31\u0e07\u0e19\u0e35\u0e49<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0e41\u0e2a\u0e14\u0e07\u0e40\u0e27\u0e25\u0e32\u0e1b\u0e31\u0e08\u0e08\u0e38\u0e1a\u0e31\u0e19<\/li>\n\n\n\n<li>\u0e15\u0e31\u0e49\u0e07\u0e40\u0e27\u0e25\u0e32\u0e1b\u0e34\u0e14\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e41\u0e1a\u0e1a\u0e19\u0e31\u0e1a\u0e16\u0e2d\u0e22\u0e2b\u0e25\u0e31\u0e07<\/li>\n\n\n\n<li>\u0e15\u0e31\u0e49\u0e07\u0e40\u0e27\u0e25\u0e32\u0e1b\u0e34\u0e14\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e15\u0e32\u0e21\u0e40\u0e27\u0e25\u0e32\u0e08\u0e23\u0e34\u0e07<\/li>\n\n\n\n<li>\u0e41\u0e2a\u0e14\u0e07\u0e40\u0e27\u0e25\u0e32\u0e19\u0e31\u0e1a\u0e16\u0e2d\u0e22\u0e2b\u0e25\u0e31\u0e07\u0e41\u0e1a\u0e1a Real-time<\/li>\n\n\n\n<li>\u0e22\u0e01\u0e40\u0e25\u0e34\u0e01\u0e01\u0e32\u0e23\u0e15\u0e31\u0e49\u0e07\u0e40\u0e27\u0e25\u0e32\u0e44\u0e14\u0e49<\/li>\n\n\n\n<li>\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e44\u0e2d\u0e04\u0e2d\u0e19\u0e02\u0e2d\u0e07\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21<\/li>\n\n\n\n<li>\u0e23\u0e2d\u0e07\u0e23\u0e31\u0e1a\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22<\/li>\n\n\n\n<li>\u0e41\u0e1b\u0e25\u0e07\u0e40\u0e1b\u0e47\u0e19\u0e44\u0e1f\u0e25\u0e4c EXE \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a Windows<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e01\u0e32\u0e23\u0e2d\u0e2d\u0e01\u0e41\u0e1a\u0e1a\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21<\/h3>\n\n\n\n<p>\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e43\u0e0a\u0e49 Java Swing \u0e42\u0e14\u0e22\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e04\u0e25\u0e32\u0e2a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\npublic class TimeComputer extends JFrame\n<\/pre><\/div>\n\n\n<p>\u0e40\u0e19\u0e37\u0e48\u0e2d\u0e07\u0e08\u0e32\u0e01 <code>JFrame<\/code> \u0e40\u0e1b\u0e47\u0e19\u0e2b\u0e19\u0e49\u0e32\u0e15\u0e48\u0e32\u0e07\u0e2b\u0e25\u0e31\u0e01\u0e02\u0e2d\u0e07\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21<\/p>\n\n\n\n<p>\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e40\u0e1b\u0e34\u0e14\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 Constructor \u0e08\u0e30\u0e16\u0e39\u0e01\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\npublic TimeComputer() {\n    setUIFont(new Font(&quot;Tahoma&quot;, Font.PLAIN, 14));\n    setIconImage(new ImageIcon(getClass().getResource(&quot;\/icon.png&quot;)).getImage());\n    initUI();\n    startClock();\n}\n<\/pre><\/div>\n\n\n<p>\u0e20\u0e32\u0e22\u0e43\u0e19 Constructor \u0e21\u0e35\u0e2b\u0e19\u0e49\u0e32\u0e17\u0e35\u0e48<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e1f\u0e2d\u0e19\u0e15\u0e4c\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22<\/li>\n\n\n\n<li>\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e44\u0e2d\u0e04\u0e2d\u0e19\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21<\/li>\n\n\n\n<li>\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e2a\u0e48\u0e27\u0e19\u0e15\u0e34\u0e14\u0e15\u0e48\u0e2d\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49 (GUI)<\/li>\n\n\n\n<li>\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19\u0e19\u0e32\u0e2c\u0e34\u0e01\u0e32<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e2b\u0e19\u0e49\u0e32\u0e15\u0e48\u0e32\u0e07\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21<\/h3>\n\n\n\n<p>\u0e20\u0e32\u0e22\u0e43\u0e19\u0e40\u0e21\u0e18\u0e2d\u0e14 <code>initUI()<\/code> \u0e43\u0e0a\u0e49\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e04\u0e38\u0e13\u0e2a\u0e21\u0e1a\u0e31\u0e15\u0e34\u0e02\u0e2d\u0e07\u0e2b\u0e19\u0e49\u0e32\u0e15\u0e48\u0e32\u0e07<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nsetTitle(&quot;\u0e15\u0e31\u0e49\u0e07\u0e40\u0e27\u0e25\u0e32\u0e1b\u0e34\u0e14\u0e04\u0e2d\u0e21\u0e1e\u0e34\u0e27\u0e40\u0e15\u0e2d\u0e23\u0e4c&quot;);\nsetSize(520,380);\nsetLocationRelativeTo(null);\nsetResizable(false);\nsetLayout(null);\n<\/pre><\/div>\n\n\n<p>\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e19\u0e35\u0e49\u0e43\u0e0a\u0e49<\/p>\n\n\n\n<p><strong>Absolute Layout<\/strong><\/p>\n\n\n\n<p>\u0e2b\u0e23\u0e37\u0e2d\u0e01\u0e32\u0e23\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e15\u0e33\u0e41\u0e2b\u0e19\u0e48\u0e07 Component \u0e14\u0e49\u0e27\u0e22\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nsetBounds(x, y, width, height);\n<\/pre><\/div>\n\n\n<p>\u0e40\u0e0a\u0e48\u0e19<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nbtnStart.setBounds(120,200,120,40);\n<\/pre><\/div>\n\n\n<p>\u0e02\u0e49\u0e2d\u0e14\u0e35\u0e04\u0e37\u0e2d\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e08\u0e31\u0e14\u0e15\u0e33\u0e41\u0e2b\u0e19\u0e48\u0e07\u0e44\u0e14\u0e49\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e2d\u0e34\u0e2a\u0e23\u0e30 \u0e40\u0e2b\u0e21\u0e32\u0e30\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e02\u0e19\u0e32\u0e14\u0e40\u0e25\u0e47\u0e01 \u0e2a\u0e48\u0e27\u0e19\u0e02\u0e49\u0e2d\u0e40\u0e2a\u0e35\u0e22\u0e04\u0e37\u0e2d\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e02\u0e19\u0e32\u0e14\u0e2b\u0e19\u0e49\u0e32\u0e15\u0e48\u0e32\u0e07\u0e2b\u0e23\u0e37\u0e2d\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e04\u0e27\u0e32\u0e21\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e2b\u0e19\u0e49\u0e32\u0e08\u0e2d \u0e15\u0e33\u0e41\u0e2b\u0e19\u0e48\u0e07\u0e02\u0e2d\u0e07 Component \u0e08\u0e30\u0e44\u0e21\u0e48\u0e1b\u0e23\u0e31\u0e1a\u0e2d\u0e31\u0e15\u0e42\u0e19\u0e21\u0e31\u0e15\u0e34<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e2a\u0e48\u0e27\u0e19\u0e15\u0e34\u0e14\u0e15\u0e48\u0e2d\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49 (GUI)<\/h3>\n\n\n\n<p>\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e1b\u0e23\u0e30\u0e01\u0e2d\u0e1a\u0e14\u0e49\u0e27\u0e22 Component \u0e2b\u0e25\u0e32\u0e22\u0e0a\u0e19\u0e34\u0e14 \u0e40\u0e0a\u0e48\u0e19<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>JLabel<\/li>\n\n\n\n<li>JButton<\/li>\n\n\n\n<li>JSpinner<\/li>\n\n\n\n<li>JRadioButton<\/li>\n\n\n\n<li>ButtonGroup<\/li>\n<\/ul>\n\n\n\n<p>\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nrbCountdown = new JRadioButton(&quot;\u0e19\u0e31\u0e1a\u0e16\u0e2d\u0e22\u0e2b\u0e25\u0e31\u0e07 (\u0e19\u0e32\u0e17\u0e35)&quot;);\nrbTimeOfDay = new JRadioButton(&quot;\u0e1b\u0e34\u0e14\u0e15\u0e32\u0e21\u0e40\u0e27\u0e25\u0e32 (\u0e0a\u0e31\u0e48\u0e27\u0e42\u0e21\u0e07:\u0e19\u0e32\u0e17\u0e35)&quot;);\n<\/pre><\/div>\n\n\n<p>\u0e41\u0e25\u0e30\u0e19\u0e33\u0e21\u0e32\u0e2d\u0e22\u0e39\u0e48\u0e43\u0e19 ButtonGroup<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nButtonGroup group = new ButtonGroup();\ngroup.add(rbCountdown);\ngroup.add(rbTimeOfDay);\n<\/pre><\/div>\n\n\n<p>\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e43\u0e2b\u0e49\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e44\u0e14\u0e49\u0e40\u0e1e\u0e35\u0e22\u0e07\u0e42\u0e2b\u0e21\u0e14\u0e40\u0e14\u0e35\u0e22\u0e27<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07\u0e40\u0e27\u0e25\u0e32\u0e1b\u0e31\u0e08\u0e08\u0e38\u0e1a\u0e31\u0e19<\/h3>\n\n\n\n<p>\u0e43\u0e0a\u0e49 Swing Timer \u0e17\u0e33\u0e07\u0e32\u0e19\u0e17\u0e38\u0e01 \u0e46 1 \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nclockTimer = new Timer(1000, e -&gt; {\n    SimpleDateFormat sdf = new SimpleDateFormat(&quot;HH:mm:ss&quot;);\n    lblClock.setText(sdf.format(new Date()));\n});\n<\/pre><\/div>\n\n\n<p>\u0e17\u0e38\u0e01 \u0e46 1 \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35 \u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e08\u0e30\u0e2d\u0e48\u0e32\u0e19\u0e40\u0e27\u0e25\u0e32\u0e1b\u0e31\u0e08\u0e08\u0e38\u0e1a\u0e31\u0e19\u0e08\u0e32\u0e01\u0e23\u0e30\u0e1a\u0e1a\u0e41\u0e25\u0e30\u0e2d\u0e31\u0e1b\u0e40\u0e14\u0e15 Label<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e01\u0e32\u0e23\u0e15\u0e31\u0e49\u0e07\u0e40\u0e27\u0e25\u0e32\u0e1b\u0e34\u0e14\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e41\u0e1a\u0e1a\u0e19\u0e31\u0e1a\u0e16\u0e2d\u0e22\u0e2b\u0e25\u0e31\u0e07<\/h3>\n\n\n\n<p>\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e42\u0e2b\u0e21\u0e14\u0e19\u0e31\u0e1a\u0e16\u0e2d\u0e22\u0e2b\u0e25\u0e31\u0e07 \u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e08\u0e30\u0e2d\u0e48\u0e32\u0e19\u0e04\u0e48\u0e32\u0e08\u0e32\u0e01<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nJSpinner\n<\/pre><\/div>\n\n\n<p>\u0e41\u0e25\u0e49\u0e27\u0e41\u0e1b\u0e25\u0e07\u0e40\u0e1b\u0e47\u0e19\u0e21\u0e34\u0e25\u0e25\u0e34\u0e27\u0e34\u0e19\u0e32\u0e17\u0e35<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nremainingMillis = minute * 60L * 1000L;\n<\/pre><\/div>\n\n\n<p>\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e2a\u0e23\u0e49\u0e32\u0e07 Timer<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nshutdownTimer = new Timer((int) remainingMillis, e -&gt; shutdownPC());\n<\/pre><\/div>\n\n\n<p>\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e04\u0e23\u0e1a\u0e40\u0e27\u0e25\u0e32\u0e08\u0e30\u0e40\u0e23\u0e35\u0e22\u0e01<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nshutdownPC();\n<\/pre><\/div>\n\n\n<p>\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e1b\u0e34\u0e14\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e04\u0e2d\u0e21\u0e1e\u0e34\u0e27\u0e40\u0e15\u0e2d\u0e23\u0e4c<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07\u0e40\u0e27\u0e25\u0e32\u0e19\u0e31\u0e1a\u0e16\u0e2d\u0e22\u0e2b\u0e25\u0e31\u0e07<\/h3>\n\n\n\n<p>\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e2a\u0e23\u0e49\u0e32\u0e07 Timer \u0e2d\u0e35\u0e01\u0e15\u0e31\u0e27\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e2d\u0e31\u0e1b\u0e40\u0e14\u0e15\u0e2b\u0e19\u0e49\u0e32\u0e08\u0e2d\u0e17\u0e38\u0e01 1 \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\ncountdownUI = new Timer(1000, e -&gt; {\n    remainingMillis -= 1000;\n});\n<\/pre><\/div>\n\n\n<p>\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e41\u0e1b\u0e25\u0e07\u0e40\u0e27\u0e25\u0e32\u0e17\u0e35\u0e48\u0e40\u0e2b\u0e25\u0e37\u0e2d<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nlong sec = remainingMillis \/ 1000;\n<\/pre><\/div>\n\n\n<p>\u0e41\u0e25\u0e49\u0e27\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25\u0e43\u0e19\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nHH:MM:SS\n<\/pre><\/div>\n\n\n<p>\u0e40\u0e0a\u0e48\u0e19<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\n01:15:42\n<\/pre><\/div>\n\n\n<p>\u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e43\u0e2b\u0e49\u0e40\u0e1b\u0e47\u0e19\u0e2a\u0e35\u0e41\u0e14\u0e07<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nlblCountdown.setForeground(Color.RED);\n<\/pre><\/div>\n\n\n<p>\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e43\u0e2b\u0e49\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e2a\u0e31\u0e07\u0e40\u0e01\u0e15\u0e40\u0e2b\u0e47\u0e19\u0e44\u0e14\u0e49\u0e07\u0e48\u0e32\u0e22<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e01\u0e32\u0e23\u0e15\u0e31\u0e49\u0e07\u0e40\u0e27\u0e25\u0e32\u0e1b\u0e34\u0e14\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e15\u0e32\u0e21\u0e40\u0e27\u0e25\u0e32\u0e08\u0e23\u0e34\u0e07<\/h3>\n\n\n\n<p>\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e2d\u0e48\u0e32\u0e19\u0e04\u0e48\u0e32\u0e08\u0e32\u0e01<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\u0e0a\u0e31\u0e48\u0e27\u0e42\u0e21\u0e07\n\u0e19\u0e32\u0e17\u0e35\n<\/pre><\/div>\n\n\n<p>\u0e41\u0e25\u0e49\u0e27\u0e40\u0e1b\u0e23\u0e35\u0e22\u0e1a\u0e40\u0e17\u0e35\u0e22\u0e1a\u0e01\u0e31\u0e1a\u0e40\u0e27\u0e25\u0e32\u0e1b\u0e31\u0e08\u0e08\u0e38\u0e1a\u0e31\u0e19<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nlong diff = targetTime.getTime() - nowTime.getTime();\n<\/pre><\/div>\n\n\n<p>\u0e2b\u0e32\u0e01\u0e40\u0e27\u0e25\u0e32\u0e17\u0e35\u0e48\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e40\u0e25\u0e22\u0e44\u0e1b\u0e41\u0e25\u0e49\u0e27<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ndiff += 24 * 60 * 60 * 1000;\n<\/pre><\/div>\n\n\n<p>\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e40\u0e25\u0e37\u0e48\u0e2d\u0e19\u0e44\u0e1b\u0e22\u0e31\u0e07\u0e27\u0e31\u0e19\u0e16\u0e31\u0e14\u0e44\u0e1b\u0e42\u0e14\u0e22\u0e2d\u0e31\u0e15\u0e42\u0e19\u0e21\u0e31\u0e15\u0e34<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e01\u0e32\u0e23\u0e1b\u0e34\u0e14\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e04\u0e2d\u0e21\u0e1e\u0e34\u0e27\u0e40\u0e15\u0e2d\u0e23\u0e4c<\/h3>\n\n\n\n<p>\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e04\u0e23\u0e1a\u0e01\u0e33\u0e2b\u0e19\u0e14 \u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e08\u0e30\u0e40\u0e23\u0e35\u0e22\u0e01<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nRuntime.getRuntime().exec(&quot;shutdown -s -t 0&quot;);\n<\/pre><\/div>\n\n\n<p>\u0e0b\u0e36\u0e48\u0e07\u0e40\u0e1b\u0e47\u0e19\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e02\u0e2d\u0e07 Windows \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e1b\u0e34\u0e14\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e17\u0e31\u0e19\u0e17\u0e35<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e01\u0e32\u0e23\u0e23\u0e2d\u0e07\u0e23\u0e31\u0e1a\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22<\/h3>\n\n\n\n<p>Swing \u0e1a\u0e32\u0e07\u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e0a\u0e31\u0e19\u0e2d\u0e32\u0e08\u0e43\u0e0a\u0e49\u0e1f\u0e2d\u0e19\u0e15\u0e4c\u0e17\u0e35\u0e48\u0e44\u0e21\u0e48\u0e23\u0e2d\u0e07\u0e23\u0e31\u0e1a\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22<\/p>\n\n\n\n<p>\u0e08\u0e36\u0e07\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e1f\u0e2d\u0e19\u0e15\u0e4c\u0e43\u0e2b\u0e21\u0e48\u0e17\u0e31\u0e49\u0e07\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nsetUIFont(new Font(&quot;Tahoma&quot;, Font.PLAIN,14));\n<\/pre><\/div>\n\n\n<p>\u0e17\u0e33\u0e43\u0e2b\u0e49 Label, Button \u0e41\u0e25\u0e30 Component \u0e15\u0e48\u0e32\u0e07 \u0e46 \u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e41\u0e2a\u0e14\u0e07\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22\u0e44\u0e14\u0e49\u0e16\u0e39\u0e01\u0e15\u0e49\u0e2d\u0e07<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e01\u0e32\u0e23\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e44\u0e2d\u0e04\u0e2d\u0e19\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21<\/h3>\n\n\n\n<p>\u0e44\u0e2d\u0e04\u0e2d\u0e19\u0e02\u0e2d\u0e07\u0e2b\u0e19\u0e49\u0e32\u0e15\u0e48\u0e32\u0e07\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e14\u0e49\u0e27\u0e22<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsetIconImage(\n    new ImageIcon(\n        getClass().getResource(&quot;\/icon.png&quot;)\n    ).getImage()\n);\n<\/pre><\/div>\n\n\n<p>\u0e44\u0e1f\u0e25\u0e4c <code>icon.png<\/code> \u0e15\u0e49\u0e2d\u0e07\u0e2d\u0e22\u0e39\u0e48\u0e43\u0e19 Resource \u0e02\u0e2d\u0e07\u0e42\u0e1b\u0e23\u0e40\u0e08\u0e01\u0e15\u0e4c\u0e08\u0e36\u0e07\u0e08\u0e30\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e42\u0e2b\u0e25\u0e14\u0e44\u0e14\u0e49<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e42\u0e04\u0e49\u0e14\u0e40\u0e15\u0e47\u0e21 TimeComputer.java<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\nimport java.awt.Font;\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java.util.Enumeration;\nimport javax.swing.*;\nimport java.awt.event.*;\nimport javax.swing.plaf.FontUIResource;\n\npublic class TimeComputer extends JFrame {\n\n    private JLabel lblClock;\n    private JLabel lblStatus;\n    private JLabel lblCountdown; \/\/ \u2b50 \u0e40\u0e1e\u0e34\u0e48\u0e21\n\n    private JRadioButton rbCountdown;\n    private JRadioButton rbTimeOfDay;\n\n    private JSpinner spMinute;\n    private JSpinner spHour;\n    private JSpinner spMin;\n\n    private JButton btnStart;\n    private JButton btnCancel;\n\n    private Timer clockTimer;\n    private Timer shutdownTimer;\n    private Timer countdownUI; \/\/ \u2b50 timer \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e2d\u0e31\u0e1b\u0e40\u0e14\u0e15\u0e40\u0e27\u0e25\u0e32\n\n    private long remainingMillis = 0; \/\/ \u2b50 \u0e40\u0e01\u0e47\u0e1a\u0e40\u0e27\u0e25\u0e32\u0e17\u0e35\u0e48\u0e40\u0e2b\u0e25\u0e37\u0e2d\n\n    public TimeComputer() {\n        setUIFont(new Font(&quot;Tahoma&quot;, Font.PLAIN, 14));\n\t\tsetIconImage(new ImageIcon(getClass().getResource(&quot;\/icon.png&quot;)).getImage());\n        initUI();\n        startClock();\n    }\n\n    private void initUI() {\n\n        setTitle(&quot;\u0e15\u0e31\u0e49\u0e07\u0e40\u0e27\u0e25\u0e32\u0e1b\u0e34\u0e14\u0e04\u0e2d\u0e21\u0e1e\u0e34\u0e27\u0e40\u0e15\u0e2d\u0e23\u0e4c&quot;);\n        setSize(520, 380);\n        setLocationRelativeTo(null);\n        setDefaultCloseOperation(EXIT_ON_CLOSE);\n        setResizable(false);\n        setLayout(null);\n\n        JLabel lblTitle = new JLabel(&quot;\u0e40\u0e27\u0e25\u0e32\u0e1b\u0e31\u0e08\u0e08\u0e38\u0e1a\u0e31\u0e19&quot;);\n        lblTitle.setBounds(30, 20, 150, 20);\n        add(lblTitle);\n\n        lblClock = new JLabel(&quot;00:00:00&quot;);\n        lblClock.setFont(new Font(&quot;Tahoma&quot;, Font.BOLD, 28));\n        lblClock.setBounds(30, 45, 250, 40);\n        add(lblClock);\n\n        \/\/ \u0e42\u0e2b\u0e21\u0e14\n        rbCountdown = new JRadioButton(&quot;\u0e19\u0e31\u0e1a\u0e16\u0e2d\u0e22\u0e2b\u0e25\u0e31\u0e07 (\u0e19\u0e32\u0e17\u0e35)&quot;);\n        rbTimeOfDay = new JRadioButton(&quot;\u0e1b\u0e34\u0e14\u0e15\u0e32\u0e21\u0e40\u0e27\u0e25\u0e32 (\u0e0a\u0e31\u0e48\u0e27\u0e42\u0e21\u0e07:\u0e19\u0e32\u0e17\u0e35)&quot;);\n\n        rbCountdown.setBounds(30, 100, 200, 25);\n        rbTimeOfDay.setBounds(250, 100, 220, 25);\n\n        ButtonGroup group = new ButtonGroup();\n        group.add(rbCountdown);\n        group.add(rbTimeOfDay);\n\n        rbCountdown.setSelected(true);\n\n        add(rbCountdown);\n        add(rbTimeOfDay);\n\n        \/\/ input countdown\n        spMinute = new JSpinner(new SpinnerNumberModel(1, 1, 9999, 1));\n        spMinute.setBounds(30, 130, 80, 30);\n        add(spMinute);\n\n        \/\/ input time\n        spHour = new JSpinner(new SpinnerNumberModel(0, 0, 23, 1));\n        spHour.setBounds(250, 130, 60, 30);\n        add(spHour);\n\n        spMin = new JSpinner(new SpinnerNumberModel(0, 0, 59, 1));\n        spMin.setBounds(320, 130, 60, 30);\n        add(spMin);\n\n        \/\/ \u0e1b\u0e38\u0e48\u0e21\n        btnStart = new JButton(&quot;\u0e40\u0e23\u0e34\u0e48\u0e21&quot;);\n        btnStart.setBounds(120, 200, 120, 40);\n        add(btnStart);\n\n        btnCancel = new JButton(&quot;\u0e22\u0e01\u0e40\u0e25\u0e34\u0e01&quot;);\n        btnCancel.setBounds(260, 200, 120, 40);\n        add(btnCancel);\n\n        \/\/ \u2b50 \u0e41\u0e2a\u0e14\u0e07 countdown \u0e08\u0e23\u0e34\u0e07\n        lblCountdown = new JLabel(&quot;00:00:00&quot;);\n        lblCountdown.setFont(new Font(&quot;Tahoma&quot;, Font.BOLD, 26));\n\t\tlblCountdown.setForeground(java.awt.Color.RED);\n        lblCountdown.setBounds(180, 260, 200, 40);\n        add(lblCountdown);\n\n        lblStatus = new JLabel(&quot;Stand-by&quot;);\n        lblStatus.setFont(new Font(&quot;Tahoma&quot;, Font.BOLD, 18));\n        lblStatus.setBounds(200, 310, 200, 30);\n        add(lblStatus);\n\n        btnStart.addActionListener(e -&gt; startShutdown());\n        btnCancel.addActionListener(e -&gt; cancelShutdown());\n    }\n\n    \/\/ ================= CLOCK =================\n    private void startClock() {\n        clockTimer = new Timer(1000, e -&gt; {\n            SimpleDateFormat sdf = new SimpleDateFormat(&quot;HH:mm:ss&quot;);\n            lblClock.setText(sdf.format(new Date()));\n        });\n        clockTimer.start();\n    }\n\n    \/\/ ================= START =================\n    private void startShutdown() {\n\n        stopAll();\n\n        if (rbCountdown.isSelected()) {\n            startCountdown();\n        } else {\n            startTimeOfDay();\n        }\n    }\n\n    \/\/ ================= COUNTDOWN =================\n    private void startCountdown() {\n\n        int minute = (Integer) spMinute.getValue();\n        remainingMillis = minute * 60L * 1000L;\n\n        \/\/ timer \u0e1b\u0e34\u0e14\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\n        shutdownTimer = new Timer((int) remainingMillis, e -&gt; shutdownPC());\n        shutdownTimer.setRepeats(false);\n        shutdownTimer.start();\n\n        \/\/ \u2b50 timer \u0e2d\u0e31\u0e1b\u0e40\u0e14\u0e15 UI \u0e17\u0e38\u0e01 1 \u0e27\u0e34\n        countdownUI = new Timer(1000, e -&gt; {\n\n            remainingMillis -= 1000;\n\n            if (remainingMillis &lt;= 0) {\n                lblCountdown.setText(&quot;00:00:00&quot;);\n                countdownUI.stop();\n                return;\n            }\n\n            long sec = remainingMillis \/ 1000;\n            long h = sec \/ 3600;\n            long m = (sec % 3600) \/ 60;\n            long s = sec % 60;\n\n            lblCountdown.setText(String.format(&quot;%02d:%02d:%02d&quot;, h, m, s));\n        });\n\n        countdownUI.start();\n\n        lblStatus.setText(&quot;\u0e19\u0e31\u0e1a\u0e16\u0e2d\u0e22\u0e2b\u0e25\u0e31\u0e07 &quot; + minute + &quot; \u0e19\u0e32\u0e17\u0e35&quot;);\n    }\n\n    \/\/ ================= TIME OF DAY =================\n    private void startTimeOfDay() {\n\n        int hour = (Integer) spHour.getValue();\n        int min = (Integer) spMin.getValue();\n\n        Date now = new Date();\n        SimpleDateFormat sdf = new SimpleDateFormat(&quot;HH:mm&quot;);\n\n        try {\n            Date nowTime = sdf.parse(sdf.format(now));\n            Date targetTime = sdf.parse(String.format(&quot;%02d:%02d&quot;, hour, min));\n\n            long diff = targetTime.getTime() - nowTime.getTime();\n\n            if (diff &lt;= 0) {\n                diff += 24 * 60 * 60 * 1000;\n            }\n\n            remainingMillis = diff;\n\n            shutdownTimer = new Timer((int) diff, e -&gt; shutdownPC());\n            shutdownTimer.setRepeats(false);\n            shutdownTimer.start();\n\n            \/\/ \u2b50 \u0e41\u0e2a\u0e14\u0e07 countdown \u0e40\u0e0a\u0e48\u0e19\u0e01\u0e31\u0e19\n            countdownUI = new Timer(1000, e -&gt; {\n\n                remainingMillis -= 1000;\n\n                long sec = remainingMillis \/ 1000;\n                long h = sec \/ 3600;\n                long m = (sec % 3600) \/ 60;\n                long s = sec % 60;\n\n                lblCountdown.setText(String.format(&quot;%02d:%02d:%02d&quot;, h, m, s));\n            });\n\n            countdownUI.start();\n\n            lblStatus.setText(&quot;\u0e08\u0e30\u0e1b\u0e34\u0e14\u0e40\u0e27\u0e25\u0e32 &quot; + String.format(&quot;%02d:%02d&quot;, hour, min));\n\n        } catch (Exception ex) {\n            ex.printStackTrace();\n        }\n    }\n\n    \/\/ ================= CANCEL =================\n    private void cancelShutdown() {\n        stopAll();\n        lblStatus.setText(&quot;Stand-by&quot;);\n        lblCountdown.setText(&quot;00:00:00&quot;);\n    }\n\n    \/\/ ================= STOP ALL =================\n    private void stopAll() {\n\n        if (shutdownTimer != null) shutdownTimer.stop();\n        if (countdownUI != null) countdownUI.stop();\n    }\n\n    \/\/ ================= SHUTDOWN =================\n    private void shutdownPC() {\n        try {\n            Runtime.getRuntime().exec(&quot;shutdown -s -t 0&quot;);\n        } catch (Exception ex) {\n            ex.printStackTrace();\n        }\n    }\n\n    \/\/ ================= FONT FIX =================\n    private void setUIFont(Font font) {\n        Enumeration&lt;Object&gt; keys = UIManager.getDefaults().keys();\n        while (keys.hasMoreElements()) {\n            Object key = keys.nextElement();\n            Object value = UIManager.get(key);\n\n            if (value instanceof FontUIResource) {\n                UIManager.put(key, new FontUIResource(font));\n            }\n        }\n    }\n\n    \/\/ ================= MAIN =================\n    public static void main(String&#x5B;] args) {\n        SwingUtilities.invokeLater(() -&gt; {\n            new TimeComputer().setVisible(true);\n        });\n    }\n}\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u0e01\u0e32\u0e23\u0e04\u0e2d\u0e21\u0e44\u0e1e\u0e25\u0e4c\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21<\/h3>\n\n\n\n<p>\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e40\u0e02\u0e35\u0e22\u0e19\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e40\u0e2a\u0e23\u0e47\u0e08\u0e41\u0e25\u0e49\u0e27 \u0e43\u0e2b\u0e49\u0e40\u0e1b\u0e34\u0e14 Command Prompt \u0e44\u0e1b\u0e22\u0e31\u0e07\u0e42\u0e1f\u0e25\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e17\u0e35\u0e48\u0e40\u0e01\u0e47\u0e1a\u0e44\u0e1f\u0e25\u0e4c<\/p>\n\n\n\n<p>\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e04\u0e2d\u0e21\u0e44\u0e1e\u0e25\u0e4c<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\njavac TimeComputer.java\n<\/pre><\/div>\n\n\n<p>\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e19\u0e35\u0e49\u0e08\u0e30\u0e17\u0e33\u0e2b\u0e19\u0e49\u0e32\u0e17\u0e35\u0e48<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a Syntax<\/li>\n\n\n\n<li>\u0e41\u0e1b\u0e25\u0e07\u0e44\u0e1f\u0e25\u0e4c <code>.java<\/code><\/li>\n\n\n\n<li>\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e44\u0e1f\u0e25\u0e4c <code>.class<\/code><\/li>\n<\/ul>\n\n\n\n<p>\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e08\u0e30\u0e44\u0e14\u0e49<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nTimeComputer.class\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e44\u0e1f\u0e25\u0e4c JAR<\/h3>\n\n\n\n<p>\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e44\u0e14\u0e49\u0e44\u0e1f\u0e25\u0e4c <code>.class<\/code><\/p>\n\n\n\n<p>\u0e43\u0e2b\u0e49\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e44\u0e1f\u0e25\u0e4c JAR<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\njar cfe time-computer.jar TimeComputer *.class\n<\/pre><\/div>\n\n\n<p>\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e19\u0e35\u0e49\u0e1b\u0e23\u0e30\u0e01\u0e2d\u0e1a\u0e14\u0e49\u0e27\u0e22<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>jar<\/strong> \u0e04\u0e37\u0e2d\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e21\u0e37\u0e2d\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e44\u0e1f\u0e25\u0e4c JAR<\/li>\n\n\n\n<li><strong>c<\/strong> (Create) \u0e2a\u0e23\u0e49\u0e32\u0e07\u0e44\u0e1f\u0e25\u0e4c\u0e43\u0e2b\u0e21\u0e48<\/li>\n\n\n\n<li><strong>f<\/strong> (File) \u0e01\u0e33\u0e2b\u0e19\u0e14\u0e0a\u0e37\u0e48\u0e2d\u0e44\u0e1f\u0e25\u0e4c\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c<\/li>\n\n\n\n<li><strong>e<\/strong> (Entry Point) \u0e23\u0e30\u0e1a\u0e38 Main Class<\/li>\n<\/ul>\n\n\n\n<p>\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e04\u0e37\u0e2d<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ntime-computer.jar\n<\/pre><\/div>\n\n\n<p>\u0e0b\u0e36\u0e48\u0e07\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e1b\u0e34\u0e14\u0e44\u0e14\u0e49\u0e14\u0e49\u0e27\u0e22 Java Runtime<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e41\u0e1b\u0e25\u0e07 JAR \u0e40\u0e1b\u0e47\u0e19 EXE \u0e14\u0e49\u0e27\u0e22 Launch4j<\/h3>\n\n\n\n<p>\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e43\u0e2b\u0e49\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e1b\u0e34\u0e14\u0e44\u0e14\u0e49\u0e40\u0e2b\u0e21\u0e37\u0e2d\u0e19\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 Windows \u0e17\u0e31\u0e48\u0e27\u0e44\u0e1b \u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e0a\u0e49 Launch4j<\/p>\n\n\n\n<p>\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e44\u0e1f\u0e25\u0e4c <code>launch4j.xml<\/code><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;launch4jConfig&gt;\n\n    &lt;outfile&gt;TimeComputer.exe&lt;\/outfile&gt;\n\n    &lt;jar&gt;time-computer.jar&lt;\/jar&gt;\n\n    &lt;icon&gt;icon.ico&lt;\/icon&gt;\n\n    &lt;headerType&gt;gui&lt;\/headerType&gt;\n\n    &lt;chdir&gt;.&lt;\/chdir&gt;\n\n    &lt;classPath&gt;\n        &lt;mainClass&gt;TimeComputer&lt;\/mainClass&gt;\n    &lt;\/classPath&gt;\n\n    &lt;jre&gt;\n        &lt;path&gt;jre&lt;\/path&gt;\n        &lt;minVersion&gt;1.8.0&lt;\/minVersion&gt;\n        &lt;bundledJre64Bit&gt;false&lt;\/bundledJre64Bit&gt;\n    &lt;\/jre&gt;\n\n&lt;\/launch4jConfig&gt;\n<\/pre><\/div>\n\n\n<p>\u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e41\u0e15\u0e48\u0e25\u0e30\u0e2a\u0e48\u0e27\u0e19<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>outfile<\/code> \u0e0a\u0e37\u0e48\u0e2d\u0e44\u0e1f\u0e25\u0e4c EXE \u0e17\u0e35\u0e48\u0e2a\u0e23\u0e49\u0e32\u0e07<\/li>\n\n\n\n<li><code>jar<\/code> \u0e23\u0e30\u0e1a\u0e38\u0e44\u0e1f\u0e25\u0e4c JAR \u0e02\u0e2d\u0e07\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21<\/li>\n\n\n\n<li><code>icon<\/code> \u0e01\u0e33\u0e2b\u0e19\u0e14\u0e44\u0e2d\u0e04\u0e2d\u0e19\u0e02\u0e2d\u0e07 EXE<\/li>\n\n\n\n<li><code>headerType<\/code> \u0e40\u0e1b\u0e47\u0e19\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e41\u0e1a\u0e1a GUI \u0e44\u0e21\u0e48\u0e41\u0e2a\u0e14\u0e07\u0e2b\u0e19\u0e49\u0e32\u0e15\u0e48\u0e32\u0e07 Console<\/li>\n\n\n\n<li><code>chdir<\/code> \u0e01\u0e33\u0e2b\u0e19\u0e14\u0e42\u0e1f\u0e25\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e17\u0e33\u0e07\u0e32\u0e19<\/li>\n\n\n\n<li><code>mainClass<\/code> \u0e23\u0e30\u0e1a\u0e38\u0e04\u0e25\u0e32\u0e2a\u0e17\u0e35\u0e48\u0e21\u0e35\u0e40\u0e21\u0e18\u0e2d\u0e14 <code>main()<\/code><\/li>\n\n\n\n<li><code>path<\/code> \u0e23\u0e30\u0e1a\u0e38\u0e42\u0e1f\u0e25\u0e40\u0e14\u0e2d\u0e23\u0e4c JRE \u0e17\u0e35\u0e48\u0e41\u0e19\u0e1a\u0e21\u0e32\u0e01\u0e31\u0e1a\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21<\/li>\n\n\n\n<li><code>minVersion<\/code> \u0e01\u0e33\u0e2b\u0e19\u0e14\u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e0a\u0e31\u0e19 Java \u0e02\u0e31\u0e49\u0e19\u0e15\u0e48\u0e33\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e43\u0e0a\u0e49<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e42\u0e04\u0e23\u0e07\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e44\u0e1f\u0e25\u0e4c\u0e2b\u0e25\u0e31\u0e07 Build<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nTimeComputer\/\n\u2502\n\u251c\u2500\u2500 TimeComputer.exe\n\u251c\u2500\u2500 time-computer.jar\n\u251c\u2500\u2500 icon.ico\n\u2514\u2500\u2500 jre\/\n<\/pre><\/div>\n\n\n<p>\u0e42\u0e14\u0e22\u0e42\u0e1f\u0e25\u0e40\u0e14\u0e2d\u0e23\u0e4c <code>jre<\/code> \u0e04\u0e37\u0e2d Java Runtime \u0e17\u0e35\u0e48\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e43\u0e0a\u0e49\u0e17\u0e33\u0e07\u0e32\u0e19<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e01\u0e32\u0e23\u0e19\u0e33\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e44\u0e1b\u0e43\u0e0a\u0e49\u0e1a\u0e19\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e2d\u0e37\u0e48\u0e19<\/h3>\n\n\n\n<p>\u0e2b\u0e32\u0e01\u0e43\u0e0a\u0e49 Launch4j \u0e1e\u0e23\u0e49\u0e2d\u0e21 Bundle JRE<\/p>\n\n\n\n<p>\u0e43\u0e2b\u0e49\u0e04\u0e31\u0e14\u0e25\u0e2d\u0e01\u0e17\u0e31\u0e49\u0e07\u0e42\u0e1f\u0e25\u0e40\u0e14\u0e2d\u0e23\u0e4c<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nTimeComputer\/\n\u251c\u2500\u2500 TimeComputer.exe\n\u251c\u2500\u2500 time-computer.jar\n\u2514\u2500\u2500 jre\/\n<\/pre><\/div>\n\n\n<p>\u0e40\u0e1e\u0e35\u0e22\u0e07\u0e40\u0e17\u0e48\u0e32\u0e19\u0e35\u0e49\u0e01\u0e47\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e1b\u0e34\u0e14\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e44\u0e14\u0e49 \u0e42\u0e14\u0e22\u0e44\u0e21\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 Java \u0e40\u0e1e\u0e34\u0e48\u0e21\u0e1a\u0e19\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e1b\u0e25\u0e32\u0e22\u0e17\u0e32\u0e07<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e2a\u0e23\u0e38\u0e1b<\/h3>\n\n\n\n<p>\u0e01\u0e32\u0e23\u0e1e\u0e31\u0e12\u0e19\u0e32\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e14\u0e49\u0e27\u0e22 Java Swing \u0e23\u0e48\u0e27\u0e21\u0e01\u0e31\u0e1a Launch4j \u0e40\u0e1b\u0e47\u0e19\u0e27\u0e34\u0e18\u0e35\u0e17\u0e35\u0e48\u0e40\u0e2b\u0e21\u0e32\u0e30\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 Desktop \u0e1a\u0e19 Windows \u0e42\u0e14\u0e22\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19\u0e08\u0e32\u0e01\u0e01\u0e32\u0e23\u0e40\u0e02\u0e35\u0e22\u0e19\u0e42\u0e04\u0e49\u0e14\u0e43\u0e19\u0e44\u0e1f\u0e25\u0e4c <code>TimeComputer.java<\/code> \u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e04\u0e2d\u0e21\u0e44\u0e1e\u0e25\u0e4c\u0e40\u0e1b\u0e47\u0e19\u0e44\u0e1f\u0e25\u0e4c <code>.class<\/code> \u0e2a\u0e23\u0e49\u0e32\u0e07\u0e40\u0e1b\u0e47\u0e19\u0e44\u0e1f\u0e25\u0e4c <code>time-computer.jar<\/code> \u0e41\u0e25\u0e30\u0e41\u0e1b\u0e25\u0e07\u0e40\u0e1b\u0e47\u0e19 <code>TimeComputer.exe<\/code> \u0e14\u0e49\u0e27\u0e22 Launch4j \u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e41\u0e19\u0e1a Java Runtime \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e43\u0e2b\u0e49\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e19\u0e33\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e44\u0e1b\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e1a\u0e19\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e2d\u0e37\u0e48\u0e19\u0e44\u0e14\u0e49\u0e17\u0e31\u0e19\u0e17\u0e35\u0e42\u0e14\u0e22\u0e44\u0e21\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 Java \u0e40\u0e1e\u0e34\u0e48\u0e21<\/p>\n\n\n\n<p>\u0e41\u0e19\u0e27\u0e17\u0e32\u0e07\u0e19\u0e35\u0e49\u0e40\u0e2b\u0e21\u0e32\u0e30\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e02\u0e19\u0e32\u0e14\u0e40\u0e25\u0e47\u0e01\u0e16\u0e36\u0e07\u0e02\u0e19\u0e32\u0e14\u0e01\u0e25\u0e32\u0e07 \u0e40\u0e0a\u0e48\u0e19 \u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e15\u0e31\u0e49\u0e07\u0e40\u0e27\u0e25\u0e32\u0e1b\u0e34\u0e14\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07 \u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 \u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e0a\u0e48\u0e27\u0e22\u0e07\u0e32\u0e19\u0e20\u0e32\u0e22\u0e43\u0e19\u0e2d\u0e07\u0e04\u0e4c\u0e01\u0e23 \u0e2b\u0e23\u0e37\u0e2d\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e21\u0e37\u0e2d\u0e2d\u0e31\u0e15\u0e42\u0e19\u0e21\u0e31\u0e15\u0e34\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e30\u0e14\u0e27\u0e01\u0e43\u0e19\u0e01\u0e32\u0e23\u0e41\u0e08\u0e01\u0e08\u0e48\u0e32\u0e22\u0e41\u0e25\u0e30\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e1a\u0e19\u0e23\u0e30\u0e1a\u0e1a\u0e1b\u0e0f\u0e34\u0e1a\u0e31\u0e15\u0e34\u0e01\u0e32\u0e23 Windows<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0e1a\u0e17\u0e19\u0e33 Java \u0e40\u0e1b\u0e47\u0e19\u0e20\u0e32\u0e29\u0e32\u0e17\u0e35\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e1e\u0e31\u0e12\u0e19\u0e32\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 Desktop \u0e44\u0e14\u0e49\u0e1c\u0e48\u0e32\u0e19 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":0,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","footnotes":""},"categories":[193,103],"tags":[],"class_list":["post-507","post","type-post","status-publish","format-standard","hentry","category-java","category-windows"],"_links":{"self":[{"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts\/507","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/comments?post=507"}],"version-history":[{"count":1,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts\/507\/revisions"}],"predecessor-version":[{"id":508,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts\/507\/revisions\/508"}],"wp:attachment":[{"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/media?parent=507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/categories?post=507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/tags?post=507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}