This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
ds:software:java11 [2019/05/07 13:50] rhaseitl |
ds:software:java11 [2019/05/21 10:14] (current) rhaseitl [weird look an asl when started via Windows/XWin] |
||
---|---|---|---|
Line 2: | Line 2: | ||
===== How to port a Java 8 GUI application to Java 11 ===== | ===== How to port a Java 8 GUI application to Java 11 ===== | ||
- | - Check out the old project from SVN on the asl cluster | + | |
- | - ... | + | |
- | - ... ToDo | + | - change the parent to < |
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | - use latest dependencies for JavaFX (or Harald' | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | - compile should now work on the command line and within NetBeans | ||
+ | - if no LSA or device access is used: the program can now only be executed by the command line, not within NetBeans | ||
+ | - LSA or DeviceAcces: | ||
===== Javadoc error ===== | ===== Javadoc error ===== | ||
- | When compiling a project on the command line with ' | + | When compiling a project on the command line with ' |
+ | < | ||
+ | [ERROR] Failed to execute goal org.apache.maven.plugins: | ||
+ | [ERROR] Exit code: 1 - javadoc: error - The code being documented uses modules but the packages defined in https:// | ||
+ | [ERROR] / | ||
+ | [ERROR] | ||
+ | [ERROR] | ||
+ | </ | ||
+ | |||
+ | **Latest news:** | ||
+ | All solutions below fail sometimes. Then it helps to remove the complete < | ||
+ | |||
+ | **Superlatest news:** | ||
+ | If you need the build section for passing command line argument, the sction can look like this: | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | Please note: Neither the plugin for the javadoc trick (see below) nor the plugin that was there before is in the build section. | ||
+ | **This is NOT used anymore: | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | **Other solutions: | ||
To solve this, add this to your pom file (be careful if you already have some other plugins within the < | To solve this, add this to your pom file (be careful if you already have some other plugins within the < | ||
Line 23: | Line 102: | ||
< | < | ||
</ | </ | ||
- | + | ||
</ | </ | ||
</ | </ | ||
Line 30: | Line 109: | ||
</ | </ | ||
+ | |||
+ | Sometimes this is not enough and a tag must be changed from exec to java in the nbactions.xml: | ||
+ | < | ||
+ | change to | ||
+ | < | ||
+ | |||
+ | ===== For Mac ===== | ||
+ | Useful YouTube video: [[https:// | ||
+ | The pom file one should download does not work anymore, so I pasted it here: | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | ===== Alert Boxes ===== | ||
+ | We might need an additional line to set the size of an alert box resizable. Otherwise the Alert Box is displayed too small and nothing can be clicked. | ||
+ | Without < | ||
+ | {{: | ||
+ | |||
+ | With < | ||
+ | {{: | ||
+ | \\ | ||
+ | Code: | ||
+ | |||
+ | < | ||
+ | Alert alert = new Alert(AlertType.CONFIRMATION); | ||
+ | alert.setTitle(" | ||
+ | alert.setHeaderText(" | ||
+ | alert.setContentText(" | ||
+ | |||
+ | ButtonType buttonTypeYes = new ButtonType(" | ||
+ | ButtonType buttonTypeNo = new ButtonType(" | ||
+ | // | ||
+ | |||
+ | alert.getButtonTypes().setAll(buttonTypeYes, | ||
+ | alert.setResizable(true); | ||
+ | alert.getDialogPane().getChildren().stream().filter(node -> node instanceof Label).forEach(node -> ((Label)node).setMinHeight(Region.USE_PREF_SIZE)); | ||
+ | Optional< | ||
+ | |||
+ | if (result.get() == buttonTypeYes) | ||
+ | { | ||
+ | // exit the application | ||
+ | exit(); | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== Launching from within NetBeans ===== | ||
+ | To start a project directly from within NetBeans, you must edit the parameters in the project properties: | ||
+ | Actions - Run project - Set Properties (adapt to your project settings): | ||
+ | < | ||
+ | metafactory.service.name.resolvers=de.gsi.bel.ap.japc.ext.devacc.GSIServiceNameResolver | ||
+ | de.gsi.aco.sv.japc.useDefaultResolverFirst=false -classpath %classpath de.gsi.lo.bi.trafos.TrafoMainApp | ||
+ | exec.executable=java | ||
+ | </ | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ===== weird look an asl when started via Windows/ | ||
+ | The dti Joda program showd this weird behaviour: | ||
+ | * when started via ssh -X, the GUI looked as intended | ||
+ | * when started via XWin32/ | ||
+ | |||
+ | As a quick solution, the window has been made resizable in the code. Then it looks as intended on all platforms. | ||
+ | |||
+ | not looking good: | ||
+ | {{: | ||
+ | |||
+ | looking good: | ||
+ | {{: |