syntheticaFX.jar
is the base for all themes and covers additional controls and panels for your
JavaFX application. Each theme is provided as a separate jar file. So for using a SyntheticaFX theme you have to add at least two libraries to
your project - the core library and the required theme library.
SyntheticaFX
which is responsible for loading and initializing. To apply a theme simply create
a new instance and initialize on application startup just like in the example below.
public class Demo extends Application {
@Override
public void start(Stage primaryStage){
new SyntheticaFXStandard().init();
...
SyntheticaFX also provides a theme which extends the default theme of JavaFX (Modena). The extension covers all required CSS for SyntheticaFX specific
components like window decoration, dialogs, validation, TitledBorderPane etc. So if you want to use Modena together with SyntheticaFX simply initialize
your application with the SyntheticaFXModena
theme.
public class Demo extends Application {
@Override
public void start(Stage primaryStage){
new SyntheticaFXModena().init();
...
Note: It's essential to integrate a SyntheticaFX RootPane
to your application to benefit from all features. For this simply
wrap the RootPane
around the content together with the related stage as parameter. By applying the settings below your application appears
in a complete new look.
public class Demo extends Application {
@Override
public void start(Stage primaryStage){
new SyntheticaFXStandard().init();
//Scene scene = new Scene(createContent(), 800, 600);
Scene scene = new Scene(new RootPane(primaryStage, createContent()), 800, 600);
primaryStage.setScene(scene);
primaryStage.setTitle("SyntheticaFX Demo");
primaryStage.show();
}
...
This is how the application looks with the JavaFX/Modena based theme - SyntheticaFXModena.
syntheticafx.base (syntheticaFX.jar)
syntheticafx.theme.modena (syntheticaFXModena.jar)
syntheticafx.theme.standard (syntheticaFXStandard.jar)
syntheticafx.xtable (xTableView.jar)
--add-exports=javafx.base/com.sun.javafx=syntheticafx.base
--add-exports=javafx.base/com.sun.javafx.collections=syntheticafx.base
--add-exports=javafx.graphics/com.sun.javafx.css=syntheticafx.base
--add-exports=javafx.graphics/com.sun.javafx.cursor=syntheticafx.base
--add-exports=javafx.base/com.sun.javafx.event=syntheticafx.base
--add-exports=javafx.graphics/com.sun.javafx.scene=syntheticafx.base
--add-exports=javafx.graphics/com.sun.javafx.tk=syntheticafx.base
--add-exports=javafx.controls/com.sun.javafx.scene.control=syntheticafx.base
--add-exports=javafx.controls/com.sun.javafx.scene.control.behavior=syntheticafx.base
--add-exports=javafx.controls/com.sun.javafx.scene.control.skin=syntheticafx.base
--add-opens=javafx.controls/javafx.scene.control=syntheticafx.base
--add-opens=javafx.controls/javafx.scene.control.skin=syntheticafx.base
When using the SyntheticaFX-Modena theme the options below are additionally required:
--add-exports=javafx.graphics/com.sun.javafx.css=syntheticafx.theme.modena
--add-exports=javafx.controls/com.sun.javafx.scene.control.skin=syntheticafx.theme.modena
When using the XTableView module the options below are additionally required:
--add-exports=javafx.controls/com.sun.javafx.scene.control=syntheticafx.xtableview
--add-opens=javafx.controls/com.sun.javafx.scene.control.behavior=syntheticafx.xtableview
--add-opens=javafx.controls/javafx.scene.control.skin=syntheticafx.xtableview
For running your application in legacy (classpath) mode you can alternatively use the settings below.
--add-exports=javafx.base/com.sun.javafx=ALL-UNNAMED
--add-exports=javafx.base/com.sun.javafx.collections=ALL-UNNAMED
--add-exports=javafx.graphics/com.sun.javafx.css=ALL-UNNAMED
--add-exports=javafx.graphics/com.sun.javafx.cursor=ALL-UNNAMED
--add-exports=javafx.base/com.sun.javafx.event=ALL-UNNAMED
--add-exports=javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED
--add-exports=javafx.graphics/com.sun.javafx.tk=ALL-UNNAMED
--add-exports=javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED
--add-exports=javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED
--add-exports=javafx.controls/com.sun.javafx.scene.control.skin=ALL-UNNAMED
--add-opens javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED
--add-opens=javafx.controls/javafx.scene.control=ALL-UNNAMED
--add-opens=javafx.controls/javafx.scene.control.skin=ALL-UNNAMED
It is also possible to put the arguments into the manifest.mf file of your application by adding the attributes below - this is the recommended method for deployment of your application in a single jar.
Add-Exports: javafx.base/com.sun.javafx javafx.base/com.sun.javafx.collections javafx.graphics/com.sun.javafx.css javafx.graphics/com.sun.javafx.cursor javafx.base/com.sun.javafx.event javafx.graphics/com.sun.javafx.scene javafx.graphics/com.sun.javafx.tk javafx.controls/com.sun.javafx.scene.control javafx.controls/com.sun.javafx.scene.control.behavior javafx.controls/com.sun.javafx.scene.control.skin
Add-Opens: javafx.controls/com.sun.javafx.scene.control.behavior javafx.controls/javafx.scene.control javafx.controls/javafx.scene.control.skin