Skip to content

Commit

Permalink
Simplify readme
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeSimcoe committed Nov 23, 2024
1 parent 9f216db commit 2213321
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 42 deletions.
41 changes: 2 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,11 @@
[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
This Quarkus extension allows you to use JavaFX in your Quarkus application. \
It will allow component injection in FX Controllers and will allow you to use CDI events to register on primary stage creation.
It will allow component injection in FX Controllers as well as many other cool features.

Please refer to documentation available at https://docs.quarkiverse.io/quarkus-fx/dev/index.html

You will be able to register on primary stage creation event via such code example.
```java
public class QuarkusFxApp {

@Inject
FXMLLoader fxmlLoader;

public void start(@Observes final FxPostStartupEvent event) {
try {
InputStream fxml = this.getClass().getResourceAsStream("/app.fxml");
Parent fxmlParent = this.fxmlLoader.load(fxml);

Stage stage = event.getPrimaryStage();

Scene scene = new Scene(fxmlParent);
stage.setScene(scene);
stage.show();

} catch (IOException e) {
// Handle error
}
}
}
```
To load multiple FXML files, you can use :
```java
@Inject
Instance<FXMLLoader> fxmlLoader;
```

Also, setting the location is required by some use cases (use of relative paths in FXML)
```java
FXMLLoader loader = this.fxmlLoader.get();
// Set location for relative path resolution
loader.setLocation(xxx);
```

For some sample apps and usage, check the `samples/` directory.
For some sample applications and usage, check the `samples/` directory.

## Contributors ✨

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/includes/quarkus-fx.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_FX_STYLESHEET_RELOAD_STRATEGY+++`
endif::add-copy-button-to-env-var[]
--
a|StylesheetReloadStrategy
a|`always`, `dev`, `never`
|`dev`

a|icon:lock[title=Fixed at build time] [[quarkus-fx_quarkus-fx-source-resources]] [.property-path]##link:#quarkus-fx_quarkus-fx-source-resources[`quarkus.fx.source-resources`]##
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_FX_STYLESHEET_RELOAD_STRATEGY+++`
endif::add-copy-button-to-env-var[]
--
a|StylesheetReloadStrategy
a|`always`, `dev`, `never`
|`dev`

a|icon:lock[title=Fixed at build time] [[quarkus-fx_quarkus-fx-source-resources]] [.property-path]##link:#quarkus-fx_quarkus-fx-source-resources[`quarkus.fx.source-resources`]##
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<module>runtime</module>
</modules>
<properties>
<quarkus.version>3.15.1</quarkus.version>
<quarkus.version>3.15.2</quarkus.version>
<javafx.version>22.0.2</javafx.version>
<maven.compiler.release>17</maven.compiler.release>
</properties>
Expand Down

0 comments on commit 2213321

Please sign in to comment.