Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcin-chwedczuk/javafx-template
Template for JavaFX GUI applications / JDK 11 / TestFX
https://github.com/marcin-chwedczuk/javafx-template
example javafx javafx-application jdk17 template
Last synced: about 2 months ago
JSON representation
Template for JavaFX GUI applications / JDK 11 / TestFX
- Host: GitHub
- URL: https://github.com/marcin-chwedczuk/javafx-template
- Owner: marcin-chwedczuk
- License: mit
- Created: 2021-06-12T17:00:41.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-08T07:46:16.000Z (almost 3 years ago)
- Last Synced: 2024-05-10T22:06:33.121Z (8 months ago)
- Topics: example, javafx, javafx-application, jdk17, template
- Language: Java
- Homepage:
- Size: 402 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JavaFX Opinionated Application Template
![Build Status](https://github.com/marcin-chwedczuk/javafx-template/actions/workflows/ci.yaml/badge.svg)
* Created for JDK 17+, with Java 9 modules support
* Multi-module Maven project by default
* Sass used instead of CSS
* assertJ and jUnit 5 used for unit testing
* TestFX used for integration testing
* Example GitHub action that builds the project and runs integration tests in headless mode### How to run application
```
./mvnw javafx:run -pl gui
```### How to rebuild `.css` files from `.scss`
```
./mvnw nl.geodienstencentrum.maven:sass-maven-plugin:update-stylesheets -pl gui
```### How to watch for SCSS changes and regenerate them when they change
```
fswatch --exclude='.*' --include='.*[.]scss$' --print0 . | while read -d "" event; do
./mvnw nl.geodienstencentrum.maven:sass-maven-plugin:update-stylesheets -pl gui
done
```
You need to install `fswatch` command for this to work.### How to generate `jlink` image
```
./mvnw javafx:jlink -pl gui
```
You can now send `./gui/target/gui.zip` to your friends :tada:### How to run integration tests (TestFX)
```
./mvnw verify -Dskip.integration.tests=false -Dskip.unit.tests=true
```### How to run single integration test
```
./mvnw clean verify -Dskip.integration.tests=false -Dskip.unit.tests=true \
-pl gui -Dit.test=MainWindowIT
```### How to run integration tests in the headless mode
```
_JAVA_OPTIONS="-Djava.awt.headless=true \
-Dtestfx.robot=glass \
-Dtestfx.headless=true \
-Dprism.order=sw \
-Dprism.verbose=true" ./mvnw verify -Dskip.integration.tests=false -pl gui
```On macOS you must allow IntelliJ or the terminal app that you are using,
to "take over your computer":
![macOS settings needed for IT](docs/macOS-it-perm.png)