javafx-9

Module javafx.controls not found in Java 9

坚强是说给别人听的谎言 提交于 2019-12-04 01:20:59
问题 I have two JPMS module in two files: modulea.jar and moduleb.jar . Modulea requires javafx.controls module. I need to use these modules in new layer, so I do: ModuleFinder finder = ModuleFinder.of(modAPath, modBPath); ModuleLayer parent = ModuleLayer.boot(); Configuration cf = parent.configuration().resolveAndBind(finder, ModuleFinder.of(), new HashSet<>()); ClassLoader scl = ClassLoader.getSystemClassLoader(); ModuleLayer newLayer = parent.defineModulesWithOneLoader(cf, scl); I thought that

Passing reference to javafx.application.Application

依然范特西╮ 提交于 2019-12-02 09:35:52
Consider a non-fx existing application, let's call it Business . Business exposes a Model object, which in turn exposes some properties. Model also accepts listeners to those properties. My question is about adding JavaFx gui to such application. The GuiApp obviously extends javafx.application.Application and will need a reference to a Model object. Searching for a solution for passing a non-String parameter to GuiApp I found several different approaches: Static approach : for example have Business initialize a static reference to Model in GuiApp . One example of the use of statics can be seen

Passing reference to javafx.application.Application

[亡魂溺海] 提交于 2019-12-02 08:04:50
问题 Consider a non-fx existing application, let's call it Business . Business exposes a Model object, which in turn exposes some properties. Model also accepts listeners to those properties. My question is about adding JavaFx gui to such application. The GuiApp obviously extends javafx.application.Application and will need a reference to a Model object. Searching for a solution for passing a non-String parameter to GuiApp I found several different approaches: Static approach : for example have

Java 9 javapacker can't find jfxrt.jar while creating bss'. Seems totally broken in “createbss” mode under Linux. How to avoid the bug?

限于喜欢 提交于 2019-12-02 04:56:03
问题 I have Ubuntu Linux system with Sun JDE 9.0.1 and I need to convert some of Fx's CSS files to binary form from console. But when I execute the command: javapackager -createbss -outdir . -srcdir . I got an error: Error: jfxrt.jar needs to be on classpath for -createbss and for -createJar without -nocss2bin My JDK is properly installed. I have all necessary modules (including FX). Any ideas how I can avoid a stupid bug and I make the packager to do it's job? If I run javapackager from "/usr/lib

Java 9 javapacker can't find jfxrt.jar while creating bss'. Seems totally broken in “createbss” mode under Linux. How to avoid the bug?

 ̄綄美尐妖づ 提交于 2019-12-02 02:28:25
I have Ubuntu Linux system with Sun JDE 9.0.1 and I need to convert some of Fx's CSS files to binary form from console. But when I execute the command: javapackager -createbss -outdir . -srcdir . I got an error: Error: jfxrt.jar needs to be on classpath for -createbss and for -createJar without -nocss2bin My JDK is properly installed. I have all necessary modules (including FX). Any ideas how I can avoid a stupid bug and I make the packager to do it's job? If I run javapackager from "/usr/lib/jvm/java-9-oracle/jmods" directory it completes without error. So right now I am using an ugly fix,

Java cannot find JavaFx classes although present in JDK

牧云@^-^@ 提交于 2019-12-01 14:18:39
I am currently working on an application using javafx for its UI. I am using java 9. When I pulled from github to continue development on my new computer and compiled, there were compilation errors at all references of javafx classes, and only javafx classes. I searched in the jdk in external resources, and the javafx package was indeed where it was supposed to be. I also made a new project using the same jdk and opened a javafx window, which worked fine. This tells me that this is a project-specific issue, rather than a system issue. Does anyone have some insight into this? Thanks. EDIT I am

Module javafx.controls not found in Java 9

这一生的挚爱 提交于 2019-12-01 05:13:30
I have two JPMS module in two files: modulea.jar and moduleb.jar . Modulea requires javafx.controls module. I need to use these modules in new layer, so I do: ModuleFinder finder = ModuleFinder.of(modAPath, modBPath); ModuleLayer parent = ModuleLayer.boot(); Configuration cf = parent.configuration().resolveAndBind(finder, ModuleFinder.of(), new HashSet<>()); ClassLoader scl = ClassLoader.getSystemClassLoader(); ModuleLayer newLayer = parent.defineModulesWithOneLoader(cf, scl); I thought that JDK modules will be loaded automatically but I get Exception in thread "main" java.lang.module

How to find the indices of the visible rows in a TableView in JavaFX 9

空扰寡人 提交于 2019-11-30 16:36:04
How do I get the indices of the visible rows in a TableView in JavaFX 9? In JavaFX 8, I can do the following: // --- The offending imports in Java 9 // import com.sun.javafx.scene.control.skin.TableViewSkin; // import com.sun.javafx.scene.control.skin.VirtualFlow; /** * This is a total hack. We need it as scrollTo jumps the selected * row to the top of the table. Jarring if the row is already * visible. As a workaround, we only scroll if the row isn't already * visible * * @return A 2 element ray with the start and end index of visible rows */ public int[] getVisibleRows() { TableView<?>

Java 9 JavaFX Preloader

不羁的心 提交于 2019-11-30 09:44:05
In Java 8 I can launch a JavaFX application with a preloader using the following method: LauncherImpl.launchApplication(WindowMain.class, WindowMainPreloader.class, new String[]{...}); I prefer to start it from code, like above, instead of using a deploy configuration, because I don't want the graphical interface to start every time I start the application, but only after some code that has computed that the application should run in GUI mode. I was using the class "com.sun.javafx.application.LauncherImpl", but apparently in Java 9 all classes starting with "com.sun" are removed. So, how can I

JavaFX: Weird ClassNotFoundException after updating to Java 9

空扰寡人 提交于 2019-11-28 01:24:45
I started a Maven project in Java 8 and wanted to migrate it to Java 9. At the same time I also went from Eclipse Neon EE to Eclipse Oxygen EE. (JFX SDK reinstalled). While the Eclipse Workspace shows no errors; as soon as I try to compile and run the exact same program that used to run perfectly fine in Java 8, I get the following Exception: {...} Caused by: java.lang.ClassNotFoundException: com.sun.javafx.css.converters.PaintConverter at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader