我试图在IntelliJ IDEA中创建JavaFX项目,但每次都会出错。
完成教程https://openjfx.io/openjfx-docs/#IDE-Intellij之后,我得到了:
Graphics Device initialization failed for : es2, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:222)
at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.base/java.lang.Thread.run(Thread.java:834)
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) …Run Code Online (Sandbox Code Playgroud) 一个CSS新手问题。
我正在两个相邻的TableViews中显示大量数据,并已双向绑定它们ScrollBar的FocusModels和SelectionModels,以使它们保持同步。
我现在正试图使两个TableView看起来像一个,并且想要拥有:
TableView s 周围的默认蓝色边框。 TableViewTableView时,两个 s 周围的默认灰色边框。TableViews相交处无国界。我将如何去做?
像这样的东西会很棒:
到目前为止,我已经可以通过执行以下操作删除“相遇”边界:
tvLeft.getStyleClass().add("my-table-view-left");
tvRight.getStyleClass().add("my-table-view-right");
Run Code Online (Sandbox Code Playgroud)
使用这样的CSS:
.my-table-view-left:focused {
-fx-background-insets: -1.4 0 -1.4 -1.4, -0.3 0 -0.3 -0.3, 1 0 1 1;
}
.my-table-view-right:focused {
-fx-background-insets: -1.4 -1.4 -1.4 0, -0.3 -0.3 -0.3 0, 1 1 1 0;
}
Run Code Online (Sandbox Code Playgroud)
TableView当选中其中一个行时,这也可以正确地将边框设置在单个边框上。
但是,我想不出如何让周围的边框既 TableView ■当任一具有焦点。
这是MVCE。抱歉,因为它的长度,但是我需要包括同步代码才能拥有一个测试用例。
我正在使用在Windows 7的Netbeans …
我一直在使用Maven测试JavaFX 11 ,但无法使其正常工作。我已经安装了Open JDK 11,如果添加jar来从可下载的.zip中构建路径,那么一切都很好。
但是,当我从javafx 11站点使用推荐的POM文件时,出现以下错误。
Exception in thread "WindowsNativeRunloopThread" java.lang.NoSuchMethodError: <init>
at javafx.graphics/com.sun.glass.ui.win.WinApplication.staticScreen_getScreens(Native Method)
at javafx.graphics/com.sun.glass.ui.Screen.initScreens(Screen.java:412)
at javafx.graphics/com.sun.glass.ui.Application.lambda$run$1(Application.java:152)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:834)
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at javafx.graphics/com.sun.prism.d3d.D3DPipeline.getAdapterOrdinal(D3DPipeline.java:205)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.assignScreensAdapters(QuantumToolkit.java:695)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runToolkit(QuantumToolkit.java:313)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$startup$10(QuantumToolkit.java:258)
at javafx.graphics/com.sun.glass.ui.Application.lambda$run$1(Application.java:153)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:834)
Run Code Online (Sandbox Code Playgroud)
这个问题似乎在这里曾经出现过,但是该线程中的任何解决方案都没有起作用。
有人对如何诊断问题有建议吗?我正在Eclipse 4.9中运行,并附加了两个项目的屏幕快照,除了一个使用maven之外,两个项目都是相同的,而另一个使用的jar添加到了构建路径。任何帮助,不胜感激。
在module-info.java我得到错误
包“ com.example”从“ javafx.base”和“ javafx.base”两者中读取包“ javafx.beans”。
迁移(从Java 8到Java 11)不仅使我感到沮丧,而且肯定会令我沮丧,这个错误对我没有任何意义。
我的依赖部分build.gradle:
def springFrameworkVersion = '5.1.2.RELEASE'
def hibernateVersion = '5.3.7.Final'
def junitJupiterVersion = '5.3.1'
dependencies {
compile 'org.transentials:cardhouse-commons:1.1.1'
compile 'ch.qos.logback:logback-classic:1.2.3'
compile "org.springframework:spring-context:$springFrameworkVersion"
compile "org.springframework:spring-jdbc:$springFrameworkVersion"
compile "org.springframework:spring-orm:$springFrameworkVersion"
compile "org.hibernate:hibernate-core:$hibernateVersion"
compile 'org.apache.commons:commons-dbcp2:2.5.0'
compile 'org.apache.commons:commons-lang3:3.8.1'
compile 'commons-io:commons-io:2.6'
compile 'com.h2database:h2:1.4.197'
compile 'javax.xml.bind:jaxb-api:2.3.1'
compile 'com.google.guava:guava:27.0-jre'
compile 'org.flywaydb:flyway-core:5.2.1'
compile 'javax.validation:validation-api:2.0.1.Final'
compile "org.openjfx:javafx-base:11:$platform"
compile "org.openjfx:javafx-graphics:11:$platform"
compile "org.openjfx:javafx-controls:11:$platform"
compile "org.openjfx:javafx-fxml:11:$platform"
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.+'
testCompile 'de.saxsys:jfx-testrunner:1.2'
testCompile 'org.apache.commons:commons-text:1.6'
testCompile "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion"
testCompile "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion"
testCompile 'org.hamcrest:hamcrest-all:1.3'
}
Run Code Online (Sandbox Code Playgroud)
和 …
java java-platform-module-system java-module java-11 javafx-11
我已经下载了支持Java 12的netbeans 11,所以我从运行JavaFX和Netbeans Non module with Maven的Gluon网页上进行了后续操作> https://openjfx.io/openjfx-docs/#next-steps
我已按照说明中的说明配置了运行此应用的操作。
运行Project clean javafx:run
但是没有指定任何调试项目的内容。有没有办法调试这个javaFX项目?
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>SimonSaysGFX</artifactId>
<version>1.0.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>12</maven.compiler.source>
<maven.compiler.target>12</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>12.0.1</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-media</artifactId>
<version>12.0.1</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>12.0.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>12</release>
</configuration>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.2</version>
<configuration>
<mainClass>com.mycompany.simonsaysgfx.App</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<name>SimonSaysGFX</name>
</project>
Run Code Online (Sandbox Code Playgroud) 我的应用程序使用Java Fx Web来显示html页面,问题是只有当我直接运行.jar时才会出现此错误,因为当我从我的ide(eclipse)运行它时它运行没有问题。有谁知道这是关于什么的吗?我正在使用 AdoptOpenJdk11。我也在同事的电脑上测试过,也是不行。
Graphics Device initialization failed for : d3d, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:244)
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:261)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at javafx.embed.swing.JFXPanel.initFx(JFXPanel.java:241)
at javafx.embed.swing.JFXPanel.<init>(JFXPanel.java:257)
at com.rubicon.game.client.window.main.menu.GameMenuPanel.<init>(GameMenuPanel.java:62)
at com.rubicon.game.client.network.states.LobbyConnectionState.enable(LobbyConnectionState.java:12)
at com.rubicon.game.client.ClientApplication.loadComponents(ClientApplication.java:115)
at com.rubicon.game.client.ClientApplication.lambda$initializate$0(ClientApplication.java:98)
at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
at com.rubicon.game.client.network.NetworkConnection.lambda$login$0(NetworkConnection.java:124)
at com.rubicon.game.core.network.packets.PacketResponse.lambda$whenComplete$0(PacketResponse.java:30)
at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
at com.rubicon.game.core.network.packets.PacketResponse.complete(PacketResponse.java:24)
at com.rubicon.game.core.network.packets.request.PacketRequestLogin.onClientReceive(PacketRequestLogin.java:43)
at com.rubicon.game.client.network.callback.PacketCallbackRequester.onReceive(PacketCallbackRequester.java:33)
at com.rubicon.game.client.network.NetworkConnection.execute(NetworkConnection.java:94)
at java.base/java.lang.Thread.run(Thread.java:834) …Run Code Online (Sandbox Code Playgroud) 我使用的是配备 M1芯片的 MacBook Air。
我尝试使用 Zulu JDK for M1 进行开发,它可以工作,但不能与 OpenJFX 一起使用。我已经使用 Zulu 与 AdoptOpenJDK 缩小了问题范围。
有谁知道 OpenJDK 何时兼容 M1 芯片?
我使用 Java 17 和 JavaFX 16 库制作了一个应用程序。有没有办法使用 JPackage 制作可安装的 32 位版本?由于自 Java 9 以来 Java 一直都是 64 位(与 JavaFX 库相同),我怀疑这是不可能的,但是有什么办法可以做到吗?
我正在尝试在 Mac 上安装 JavaFX 15,但我遇到了困难。
运行 MacOS Mojave 10.14.6
我已经安装了 Java 13 JDK 并设置了 Home 文件夹,从https://gluonhq.com/products/javafx/下载了 JavaFX SDK ,我已经运行了代码“export PATH_TO_FX=/Users/.../ Mac 终端中的 javafx-sdk-15/lib”。
我正在使用 IntelliJ 进行编程,我尝试在项目结构 - 库中设置路径
但应用程序无法编译。
有人可以帮助我吗?预先非常感谢!
我正在使用带有 Java 的 Eclipse IDE 2020-03 版本。我正在尝试使用 FXML,在线检查了一些教程和步骤并遵循它们。但我仍然收到以下错误:
启动层 java.lang.module.FindException 初始化期间发生错误:未找到模块 javafx.controls
我用谷歌搜索寻求帮助。有很多人遇到同样的问题并且能够解决这个问题。但我所看到的只是他们使用 NetBeans IDE 或 IntelliJ。有人有 Eclipse 的解决方案吗?任何帮助,将不胜感激。
我按照本教程 - > https://www.youtube.com/watch?v=bC4XB6JAaoU。这是我目前拥有的:
从 Market Place 安装的 e(fx)clipse 3.6.0
“Java Build Path”包含库(我当时使用的是15.0,然后切换回14.0,但错误仍然存在)
“Java Build Path”包含库(我当时使用的是15.0,然后切换回14.0,但错误仍然存在)
VM 参数具有以下行(指向库位置): --module-path "C:\Users\my_name\Documents\Scene Builder\openjfx-14.0.1_windows-x64_bin-sdk\javafx-sdk-14.0.1\lib" --add-modules javafx.controls,javafx.fxml
我尝试在 eclipse.ini 文件中使用“-clean”,但没有帮助。事实上,当我尝试创建新的简单项目并再次执行所有步骤时,Java 甚至无法识别 JavaFX。
谢谢!