2. Dependency
<properties>
<java.version>22</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<encoding>UTF-8</encoding>
<project.build.sourceEncoding>${encoding}</project.build.sourceEncoding>
<project.reporting.outputEncoding>${encoding}</project.reporting.outputEncoding>
<openjfx.version>22</openjfx.version>
<asm.version>7.2</asm.version>
<maven.compiler.plugin>3.8.1</maven.compiler.plugin>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${openjfx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>${openjfx.version}</version>
</dependency>
</dependencies>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin}</version>
<configuration>
<encoding>${encoding}</encoding>
<source>${java.version}</source>
<target>${java.version}</target>
<release>${java.version}</release>
<parameters>true</parameters>
<compilerArgs>--enable-preview</compilerArgs>
</configuration>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>${asm.version}</version>
</dependency>
</dependencies>
</plugin>
3. JavaFx Setup
-
Download JavaFx Sdk,创建JAVAFX_SDK_HOME,
JAVAFX_SDK_HOME ⇒ E:\Install\Dev\OpenJFx2201\lib; -
项目下创建文件夹JavaFxLibrary,将下载的Sdk/lib下jar复制到JavaFxLibrary;
-
创建User Libraries,添加JavaFxLibrary下的jar,clean package;
-
Run As ⇒ Run Configurations ⇒ Arguments ⇒ VM arguments ⇒
--module-path "E:\Install\Dev\OpenJFx2201\lib" \
--add-modules javafx.controls,javafx.fxml
4. JavaFx Visualization
-
安装插件efxclipse,下载并安装JavaFX Scene Builder;
-
JAVAFX_SCENE_BUILDER_HOME ⇒ E:\Install\Dev\SceneBuilder;
-
Eclipse配置JavaFX Scene Builder:Windows ⇒ References ⇒ JavaFx;
Entry | Memo |
---|---|
Executable |
E:\Install\Dev\SceneBuilder\JavaFX Scene Builder 2.0.exe |
JavaFx22 + Sdk |
E:\Install\Dev\OpenJFx2201\ |