2

This is how I proceeded.

1. Ensure that your classpath contains all required Synthetica libraries, means the core library (synthetica.jar) and the used theme library. Note: In Synthetica V3 the core library contains Synthetica core files only, no themes. Since V3 the standard theme is not any longer part of the core library! So you have to put all required theme libraries on your classpath or modulepath too.
Library image

2. Enable Synthetica Look and Feel on application startup. Theme class names follows the syntax below: de.javasoft.synthetica.[theme].Synthetica[theme]LookAndFeel

 //Example - Dark theme:

 import de.javasoft.synthetica.dark.SyntheticaDarkLookAndFeel;

 public static void main(String[] args) throws Exception
 {
   UIManager.setLookAndFeel(new SyntheticaDarkLookAndFeel();
   EventQueue.invokeLater(() -> new MyDesktopApplication());
   ... 

Import image , Implementation Image

JPMS module names

3. All modules of Synthetica V3 are listed below. Synthetica BlackMoon theme -> synthetica.theme.blackmoon (...)

Module export

4. Problem :

Exception in thread "main" java.lang.IllegalAccessError: class de.javasoft.plaf.synthetica.SyntheticaLookAndFeel (in module synthetica.base) cannot access class sun.swing.DefaultLookup (in module java.desktop) because module java.desktop does not export sun.swing to module synthetica.base
at synthetica.base/de.javasoft.plaf.synthetica.SyntheticaLookAndFeel.initialize(SyntheticaLookAndFeel.java:836)
at java.desktop/javax.swing.UIManager.setLookAndFeel(UIManager.java:586)
at LogicielDeTrading/base.Main.main(Main.java:397)

5. The problem wouldn't certainly be solved including all the modules from the JDK. -> Java: Is `sun.awt.image` package deprecated? So i add in JVM:

--add-exports=java.desktop/sun.awt.image=<yourModuleName>
--add-exports=java.desktop/sun.awt.image=ALL-UNNAMED

6. Same problem.

Source : LookAndFeel Java Synthetica in Eclipse Source : Java: Is `sun.awt.image` package deprecated? Source : How to add a look and feel to my project?

0 Answers0