stechy1
JCHJava Community | Help. Code. Learn.
•Created by stechy1 on 12/4/2023 in #java-help
JavaFX dialogs internationalization
Hello, I have foud an issue with translating buttons in built-in JavaFX dialogs. I have an application where I'm using "java modules".
My goal is to be able to translate every single button in dialog.
Translation resources are available on this place: https://github.com/openjdk/jfx/blob/master/modules/javafx.controls/src/main/resources/com/sun/javafx/scene/control/skin/resources
Resources are loaded throu this class: https://github.com/openjdk/jfx/blob/master/modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/skin/resources/ControlResources.java
Without "java modules" I could simply create custom translation in my projects resources "com/sun/javafx/scene/control/skin/resources" and it should work. But when "java modules" are used, this is not allowed because package "com.sun.javafx.scene.control.skin.resources" would exist in multiple modules, which is not allowed.
Does anyone had to solve this kind of issue?
Thank you.
4 replies
JCHJava Community | Help. Code. Learn.
•Created by stechy1 on 11/21/2023 in #java-help
Include test code in another module
Hello, I'm facing an issue with dependencies / class imports. For demonstration purposes, I have created a minimal reproduction repository: https://github.com/stechy1/java-module-test-issue
There are two modules in the repository: submodule1 and submodule2. Submodule2 depends on submodule1. Dependent classes from submodule1 are visible in submodule2 without any issues. Same is for tests. So it means it is possible to create an instance of the class Example1 in the class Example2. Same is possible to do in Test2 with class Test1 from submodule1.
Now the issue come, when java modules are activated. To do so, rename module-info.java.txt to module-info.java. The compilation fail, because class Test1 become not visible in class Test2.
I have my own reasons why I'm trying to reach classes from submodule1 in submodule2. Also module-info is mandatory to be activated, because the whole project is using modules.
Thank you for any ideas how to solve this issue. If you do not understand something, ping me, I will try explain better.
29 replies