code.makery.ch icon indicating copy to clipboard operation
code.makery.ch copied to clipboard

Migrate JavaFX Tutorial to Java 9

Open marcojakob opened this issue 6 years ago • 3 comments

marcojakob avatar Apr 20 '18 21:04 marcojakob

Possible Solution, posted by Andreas A.

Hi Marco, hi Nik

First of all: Thanks Marco for your absolutely amazing tutorial, wow!!

I have the following solution, so it works in Java 9 with the new modules system: You just have to add a file named "module-info.java" in your /src-folder. It should contain the following 'requires' and the following 'opens'-statements, that's all. So, the file "module-info.java" should look like:

module CodeMakery.AdressApp { //noinspection removal requires java.xml.bind; requires javafx.base; requires javafx.fxml; requires javafx.controls; requires java.prefs;

opens ch.makery.address; opens ch.makery.address.view; opens ch.makery.address.model; opens ch.makery.address.util; }

I've done some more detailed explanation on my GitHub. There you can see and download the whole source code of the file including the explanations (and the whole app if you want): https://github.com/AndiSwiss/AddressApp/blob/master/src/module-info.java

Cheers, Andreas A.

marcojakob avatar Apr 20 '18 21:04 marcojakob

I was just thinking about this tutorial the other day; it's where I got started with JavaFX. I came here wondering about updating it to Java 11+.

Is there something that could take JAXB's place that would still allow you to store the data in some format?

UgmaDevelopment avatar Jan 21 '21 23:01 UgmaDevelopment

@UgmaDevelopment I haven't been following Java lately. Maybe someone else can answer that question.

marcojakob avatar Jan 22 '21 06:01 marcojakob