Getting Started with JavaFX
https://openjfx.io/openjfx-docs/#maven
Run HelloWorld using Maven
If you want to develop JavaFX applications using Maven, you don't have to download the JavaFX SDK. Just specify the modules and the versions you want in the pom.xml, and the build system will download the required modules, including the native libraries for your platform.
Here is a pom.xml file which shows how to achieve this, included in this sample.
Alternatively, we have created JavaFX Maven Archetypes to quickly create Maven projects. A simple JavaFX project can be created by executing the following command:
mvn archetype:generate \
-DarchetypeGroupId=org.openjfx \
-DarchetypeArtifactId=javafx-archetype-simple \
-DarchetypeVersion=0.0.3 \
-DgroupId=org.openjfx \
-DartifactId=sample \
-Dversion=1.0.0 \
-Djavafx-version=17
The pom uses the JavaFX Maven plugin:
<plugins>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<configuration>
<mainClass>HelloFX</mainClass>
</configuration>
</plugin>
</plugins>
Add the maven dependencies:
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>17</version>
</dependency>
</dependencies>
Important: Note that transitive dependencies are automatically resolved (for instance, there is no need to add a dependency for the javafx.graphics module, since it is transitively resolved by the javafx.controls module). But if your application is using FXML, you will need to add a dependency for the javafx.fxml module as well.
Finally, run the application (e.g. based on the HelloFX.java from the referred sample):
mvn clean javafx:run
Getting Started with JavaFX的更多相关文章
- 问题记录:JavaFx 鼠标滑轮滚动事件监听!
问题描述: 在listview的item里面添加鼠标拖拽排序功能.代码如下: setOnMouseDragged(event -> { //设定鼠标长按0.3秒后才可拖拽 防止误操作 isCan ...
- JavaFx客户端服务器C/S架构搭建
客户端获取服务器端软件更新版本方法: package com.platform.ui.update; import java.io.BufferedInputStream; import java.i ...
- JavaFX 教程资料收集
1. JavaFX中文资料 http://www.javafxchina.net/blog/docs/tutorial1/ 2. JavaFX入门教程 http://www.xrpmoon.com/c ...
- 在 linux 上部署并运行 JavaFX 项目
环境 redhat 6.4.eclipse安装JavaFX插件 项目详情及代码参见 在linux上配置并创建JavaFX项目 ,该部署即此文章中项目的部署 配置build.fxbuild 生成buil ...
- 在linux上配置并创建JavaFX项目
本环境为linux配置,因为这里的JavaFX项目是为定制Oracle监控工具而写的.现Oracle已收购Java好几年,用它自己的产生监控自己的东西还是很兼容的.此处Eclipse 为4.5版本. ...
- javafx之登陆界面的跳转
界面布局用到的是fxml而非纯java代码,工具是javafx sence builder 账号:account 密码:password 登陆成功: 可以点击退出登陆返回到登陆页面 工程目录: pac ...
- JAVAFX纯手写布局
主页面效果: 第一栏的效果: 工程目录: package MessageBean; /** * * @author novo */ public class Message { private Str ...
- javafx之HTTP协议交互
javafx端要获取获取如下信息: 服务器端获取的数据: javafx客户端发送的数据以及获取的数据: 工程目录: package Httputil; import IPsite.IPaddress; ...
- eclipse开发 javafx(转)
了解过JavaFX的都知道,JavaFX自从2.0版本开始,已经完全抛弃了之前的script语言,才用纯java来实现.这样的好处就是1.让使用Java的IDE进行JavaFX的开发成为可能,2.Ja ...
- JavaFX結合 JDBC, Servlet, Swing, Google Map及動態產生比例圖 (3):部署設定及應用 (转帖)
說明:這一篇主要是說明如何將程式部署到Application Server,以及程式如何運作,產生的檔案置於何處,以及如何以瀏覽器呈現(Applet),或是當成桌面應用程式,或是 桌面Applet,這 ...
随机推荐
- 使用c++ onnxruntime构建项目出现的bug
bug1:The given version [11] is not supported, only version 1 to 7 is supported in this build. 应该是加载了 ...
- 专场直播预约 | 邀您探讨KaiwuDB 离散制造业场景解决方案
先导语 近日,KaiwuDB 携手山东重工集团有限公司(以下简称:山东重工) 重磅发布"离散制造业解决方案".该方案以 KaiwuDB 就地运算技术专利技术为底座,搭建了&quo ...
- idea创建搭建项目 maven eg
1. 创建一个空的项目 ps:作为 git 管理 ,父项目 2. 创建第一个微服务 先导入两个必要的组件 web spring web : spring cloud openfeign (用于微服务之 ...
- vue 的响应式原理
首先,遍历data的数据,通过 Obejct.defineProperty 定义数据,给数据加上 geter 和 setter 函数,获取数据触发 getter函数, 修改数据时触发 setter函数 ...
- 激活windows教程
新建bat文件 [批处理文件:后缀是 bat ] 输入代码: slmgr/skms kms.03k.org slmgr/ato 然后以管理员运行 :
- kotlin协程——>共享的可变状态与并发
共享的可变状态与并发 协程可⽤多线程调度器(⽐如默认的 Dispatchers.Default)并发执⾏.这样就可以提出所有常⻅的并发 问题.主要的问题是同步访问共享的可变状态.协程领域对这个问题的⼀ ...
- log4j2配置自定义filter报错Unable to invoke factory method in class
报错Unable to invoke factory method in class com....log4j.ScheduleLoggerFilter 2020-05-13 16:32:35,613 ...
- 如何使用 VuePress 搭建博客网站并 Vercel 部署
先来看一下网站截图: 快速上手 1.创建并进入一个新目录 mkdir vuepress-starter && cd vuepress-starter 2.使用你喜欢的包管理器进行初始化 ...
- RabbitMQ3.8.16安装延迟队列插件
安装过程 1:RabbitMQ 延迟插件GitHub 2:各版本地址 如我的MQ版本是3.8.16,那么根据提示下载的版本是: ①:移动插件到RabbitMQ的插件目录下,如我的位置是:/usr/li ...
- Analysis I Chapter 2 - By Professor Terence Tao
目录 2.1 The Peano Axioms 2.2 Addition - Exercises 2.2 - 2.3 Multiplication - Exercises 2.3 - Method o ...