You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by HRH <hr...@yahoo.com.INVALID> on 2020/08/15 18:34:31 UTC
FXML import statement issue in Maven based project
Hi,
I had an FXML file that was working fine until I added an UI component "WebView". The <?import javafx.scene.web.WebView?> in the FXML file marked as an error because somehow the javafx.web from the JavaFx\Lib is not seen. I have already modified the POM file to include this dependency as follow alas the FXMLLoader.load() failes to load the FXML file and it throws a runtime exception:
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>14</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>14</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>14</version>
</dependency>
</dependencies>
Any insight as why the <?import javafx.scene.web.WebView?> cause an error?
Thanks in advance.
Re: FXML import statement issue in Maven based project
Posted by HRH <hr...@yahoo.com.INVALID>.
Chuck, you are right, the "requires phrase" was the only step needed. Perhaps, to eliminate manual intervention, this can be automated at some future point. On Sunday, August 16, 2020, 6:18:12 AM GMT+4:30, Chuck Davis <cj...@gmail.com> wrote:
I think all you need is the requires phrase.
On Sat, Aug 15, 2020 at 6:42 PM HRH <hr...@yahoo.com> wrote:
Thanks, that was the missing part that caused the error. Do I need to revise the statement that begins with the "opens" directive? I took the liberty and changed it. The module file looks as follow:
module org.openjfx.fxmavenfxml {
requires javafx.controls;
requires javafx.fxml;
requires javafx.base;
requires javafx.graphics;
requires java.base;
requires javafx.web;
// opens org.openjfx.fxmavenfxml to javafx.fxml;
opens org.openjfx.fxmavenfxml to javafx.web;
exports org.openjfx.fxmavenfxml;
}
Should I keep the new "opens org.openjfx.fxmavenfxml to javafx.web;"?
Thanks again
On Sunday, August 16, 2020, 12:49:46 AM GMT+4:30, Chuck Davis <cj...@gmail.com> wrote:
Did you revise the module file?
On Sat, Aug 15, 2020 at 11:34 AM HRH <hr...@yahoo.com.invalid> wrote:
Hi,
I had an FXML file that was working fine until I added an UI component "WebView". The <?import javafx.scene.web.WebView?> in the FXML file marked as an error because somehow the javafx.web from the JavaFx\Lib is not seen. I have already modified the POM file to include this dependency as follow alas the FXMLLoader.load() failes to load the FXML file and it throws a runtime exception:
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>14</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>14</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>14</version>
</dependency>
</dependencies>
Any insight as why the <?import javafx.scene.web.WebView?> cause an error?
Thanks in advance.
Re: FXML import statement issue in Maven based project
Posted by Chuck Davis <cj...@gmail.com>.
I think all you need is the requires phrase.
On Sat, Aug 15, 2020 at 6:42 PM HRH <hr...@yahoo.com> wrote:
> Thanks, that was the missing part that caused the error. Do I need to
> revise the statement that begins with the "opens" directive? I took the
> liberty and changed it. The module file looks as follow:
>
> module org.openjfx.fxmavenfxml {
> requires javafx.controls;
> requires javafx.fxml;
> requires javafx.base;
> requires javafx.graphics;
> requires java.base;
> requires javafx.web;
>
> // opens org.openjfx.fxmavenfxml to javafx.fxml;
> opens org.openjfx.fxmavenfxml to javafx.web;
> exports org.openjfx.fxmavenfxml;
> }
>
> Should I keep the new "opens org.openjfx.fxmavenfxml to javafx.web;"?
>
> Thanks again
> On Sunday, August 16, 2020, 12:49:46 AM GMT+4:30, Chuck Davis <
> cjgunzel@gmail.com> wrote:
>
>
> Did you revise the module file?
>
> On Sat, Aug 15, 2020 at 11:34 AM HRH <hr...@yahoo.com.invalid> wrote:
>
> Hi,
>
> I had an FXML file that was working fine until I added an UI component
> "WebView". The <?import javafx.scene.web.WebView?> in the FXML file
> marked as an error because somehow the javafx.web from the JavaFx\Lib is
> not seen. I have already modified the POM file to include this dependency
> as follow alas the FXMLLoader.load() failes to load the FXML file and it
> throws a runtime exception:
>
> <dependencies>
> <dependency>
> <groupId>org.openjfx</groupId>
> <artifactId>javafx-controls</artifactId>
> <version>14</version>
> </dependency>
> <dependency>
> <groupId>org.openjfx</groupId>
> <artifactId>javafx-fxml</artifactId>
> <version>14</version>
> </dependency>
> <dependency>
> <groupId>org.openjfx</groupId>
> <artifactId>javafx-web</artifactId>
> <version>14</version>
> </dependency>
> </dependencies>
>
> Any insight as why the <?import javafx.scene.web.WebView?> cause an error?
>
> Thanks in advance.
>
>
Re: FXML import statement issue in Maven based project
Posted by HRH <hr...@yahoo.com.INVALID>.
Thanks, that was the missing part that caused the error. Do I need to revise the statement that begins with the "opens" directive? I took the liberty and changed it. The module file looks as follow:
module org.openjfx.fxmavenfxml {
requires javafx.controls;
requires javafx.fxml;
requires javafx.base;
requires javafx.graphics;
requires java.base;
requires javafx.web;
// opens org.openjfx.fxmavenfxml to javafx.fxml;
opens org.openjfx.fxmavenfxml to javafx.web;
exports org.openjfx.fxmavenfxml;
}
Should I keep the new "opens org.openjfx.fxmavenfxml to javafx.web;"?
Thanks again
On Sunday, August 16, 2020, 12:49:46 AM GMT+4:30, Chuck Davis <cj...@gmail.com> wrote:
Did you revise the module file?
On Sat, Aug 15, 2020 at 11:34 AM HRH <hr...@yahoo.com.invalid> wrote:
Hi,
I had an FXML file that was working fine until I added an UI component "WebView". The <?import javafx.scene.web.WebView?> in the FXML file marked as an error because somehow the javafx.web from the JavaFx\Lib is not seen. I have already modified the POM file to include this dependency as follow alas the FXMLLoader.load() failes to load the FXML file and it throws a runtime exception:
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>14</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>14</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>14</version>
</dependency>
</dependencies>
Any insight as why the <?import javafx.scene.web.WebView?> cause an error?
Thanks in advance.
Re: FXML import statement issue in Maven based project
Posted by Chuck Davis <cj...@gmail.com>.
Did you revise the module file?
On Sat, Aug 15, 2020 at 11:34 AM HRH <hr...@yahoo.com.invalid> wrote:
> Hi,
>
> I had an FXML file that was working fine until I added an UI component
> "WebView". The <?import javafx.scene.web.WebView?> in the FXML file
> marked as an error because somehow the javafx.web from the JavaFx\Lib is
> not seen. I have already modified the POM file to include this dependency
> as follow alas the FXMLLoader.load() failes to load the FXML file and it
> throws a runtime exception:
>
> <dependencies>
> <dependency>
> <groupId>org.openjfx</groupId>
> <artifactId>javafx-controls</artifactId>
> <version>14</version>
> </dependency>
> <dependency>
> <groupId>org.openjfx</groupId>
> <artifactId>javafx-fxml</artifactId>
> <version>14</version>
> </dependency>
> <dependency>
> <groupId>org.openjfx</groupId>
> <artifactId>javafx-web</artifactId>
> <version>14</version>
> </dependency>
> </dependencies>
>
> Any insight as why the <?import javafx.scene.web.WebView?> cause an error?
>
> Thanks in advance.
>
>