programming:java:javafx
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| programming:java:javafx [2023/11/01 07:31] – removed - external edit (Unknown date) 127.0.0.1 | programming:java:javafx [2023/11/01 07:31] (current) – ↷ Page moved from camunda:programming:java:javafx to programming:java:javafx skipidar | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Java FX ====== | ||
| + | The fastest way to create Java FX Applications - is to combine it with Eclipse RCP. | ||
| + | |||
| + | |||
| + | == Fallpits == | ||
| + | * Lookout, that your PATH contains the **JDK** not the JRE. Can see in IDE what is really used in Projects: | ||
| + | * | ||
| + | |||
| + | == IDE == | ||
| + | The IDE is the E(fx)clipse. Eclipse with some plugins made for Java FX: http:// | ||
| + | |||
| + | |||
| + | |||
| + | == Examples of different Projects == | ||
| + | To create an Eclipse RCP project, based on Java FX follow this tutorials: http:// | ||
| + | |||
| + | |||
| + | ==== Eclipse4 SWT App with single JavaFX Part embedded ==== | ||
| + | |||
| + | **TARGET** | ||
| + | 1. add http:// | ||
| + | |||
| + | **PROJECT** \\ | ||
| + | 2. create an RCP Project | ||
| + | |||
| + | 3. add plugins and features to the **product** and to your **launch config** | ||
| + | * at.bestsolution.efxclipse.runtime.javafx | ||
| + | * at.bestsolution.efxclipse.runtime.osgi | ||
| + | |||
| + | 4. add the following to make the RCP use at.bestsolution.osgi implementation, | ||
| + | pass **-Dosgi.framework.extensions=at.bestsolution.efxclipse.osgi** in your launch config' | ||
| + | |||
| + | < | ||
| + | |||
| + | 5. set launch configurations "clear all" | ||
| + | |||
| + | |||
| + | ===== Intellij Idea ===== | ||
| + | |||
| + | ==== JavaFX project ==== | ||
| + | |||
| + | Building JavaFx apps. | ||
| + | |||
| + | You can start creating a JavaFX project. \\ | ||
| + | The structure won't fit the gradle structure but this can be edited later. \\ | ||
| + | {{https:// | ||
| + | |||
| + | To make Idea build the jar, when selecting **Build > Build Project** select " | ||
| + | the jar will be generated under " | ||
| + | {{https:// | ||
| + | |||
| + | |||
| + | |||
| + | modify the project structure, to fit gradle structure \\ | ||
| + | TODO | ||
| + | |||
| + | |||
| + | add build.gradle \\ | ||
| + | TODO | ||
| + | |||
| + | < | ||
| + | gradle assemble | ||
| + | gradle run | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Gradle Project ==== | ||
| + | It is better to use a Gradle project, because Gradle can be used completely headless, on the CI. | ||
| + | And the result will be the same, when using the Gradle mode inside of the IDE. | ||
| + | |||
| + | Here is a gradle-stub-project for a JavaFX app | ||
| + | < | ||
| + | https:// | ||
| + | </ | ||
| + | |||
| + | It was created by building rebuilding an Idea project to a maven structure \\ | ||
| + | and then adding a build.gradle, | ||
| + | capable to build this project, \\ | ||
| + | and then reimporting the project to idea as a gradle (not as JavaFX project) | ||
| + | |||
| + | To use this project: | ||
| + | - pull the gradle project | ||
| + | - Go to FIle > Open > build.gradle | ||
| + | - Configure the project, by specifying the location of your Java SDK | ||
| + | |||
| + | |{{https:// | ||
| + | |||
| + | |||
| + | |||
| + | == Gradle Tools == | ||
| + | |||
| + | The available Gradle-Tasks are available in IDEA via **View > Tool Window > Gradle** | ||
| + | |||
| + | To update the project from build gradle use the sync button at the left part ofr the gradle tools | ||
| + | |||
| + | {{https:// | ||
| + | |||
| + | |||
| + | |||
| + | To reimport the project form build.gradle use **File > Invalidate Caches / Restart** | ||
| + | |||
| + | {{https:// | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
