intellij idea - javafx.embed.swing.JFXPanel import not working - Stack Overflow

I'm creating a project for school that requires me to use java swing and the api i chose has OAuth

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745585614a4634520.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信