admin管理员组文章数量:1024026
I'm creating a project for school that requires me to use java swing and the api i chose has OAuth2 authentication so I decided that I could have one of my views have the browser embeded into it using JFX. For some reason though i've had trouble importing javafx.swing package into my project and the import javafx.embed.swing.JFXPanel; line does not recognize embed as a package available. I am using intellij IDEA with jdk 22 and I have javafx-swing version 23 loaded in as a dependency in my maven structure. Does anyone know if they changed the name of the package or if there's any other way to embed a browser into my java swing GUI. Any ideas would be appreciated.
<dependency>
<groupId>.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>20.0.2</version>
</dependency>
<dependency>
<groupId>.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>23</version>
</dependency>
<dependency>
<groupId>.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>20.0.1</version>
</dependency>
<dependency>
<groupId>.openjfx</groupId>
<artifactId>javafx-swing</artifactId>
<version>23</version> <!-- Add javafx-embed-swing -->
</dependency>
I've tried changing versions in my maven dependency and i checked the documentation online to see if any name had changed to no avail.
EDIT-- The issue was that I was using different versions of JavaFX for all my JavaFX dependencies, changing them to ALL be version 20.0.1 seemed to work for me.
I'm creating a project for school that requires me to use java swing and the api i chose has OAuth2 authentication so I decided that I could have one of my views have the browser embeded into it using JFX. For some reason though i've had trouble importing javafx.swing package into my project and the import javafx.embed.swing.JFXPanel; line does not recognize embed as a package available. I am using intellij IDEA with jdk 22 and I have javafx-swing version 23 loaded in as a dependency in my maven structure. Does anyone know if they changed the name of the package or if there's any other way to embed a browser into my java swing GUI. Any ideas would be appreciated.
<dependency>
<groupId>.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>20.0.2</version>
</dependency>
<dependency>
<groupId>.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>23</version>
</dependency>
<dependency>
<groupId>.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>20.0.1</version>
</dependency>
<dependency>
<groupId>.openjfx</groupId>
<artifactId>javafx-swing</artifactId>
<version>23</version> <!-- Add javafx-embed-swing -->
</dependency>
I've tried changing versions in my maven dependency and i checked the documentation online to see if any name had changed to no avail.
EDIT-- The issue was that I was using different versions of JavaFX for all my JavaFX dependencies, changing them to ALL be version 20.0.1 seemed to work for me.
本文标签: intellij ideajavafxembedswingJFXPanel import not workingStack Overflow
版权声明:本文标题:intellij idea - javafx.embed.swing.JFXPanel import not working - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745585611a2157575.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论