- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在运行演示 TreeView 控件使用的简单程序时,出现以下异常:
java.lang.RuntimeException:创建节点时出错:类 javafx.scene.layout.StackPane id:null
使用子项展开或关闭 TreeItem 时会发生此错误。
这是 SSCCE:
import static javafx.application.Application.launch;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeView;
import javafx.stage.Stage;
public class TreeViewTest extends Application {
Tab treeTab;
@Override
public void start(Stage primaryStage) throws Exception {
TabPane pane = new TabPane();
Scene scene = new Scene(pane,800,600);
treeTab = new Tab("Tree");
pane.getTabs().addAll(treeTab);
primaryStage.setTitle("F(X)yz - Collision Test");
primaryStage.setScene(scene);
primaryStage.show();
makeTree();
}
private void makeTree(){
TreeItem<String> treeItemRoot = new TreeItem<> ("Root");
TreeItem<String> nodeItemA = new TreeItem<>("Item A");
TreeItem<String> nodeItemB = new TreeItem<>("Item B");
TreeItem<String> nodeItemC = new TreeItem<>("Item C");
treeItemRoot.getChildren().addAll(nodeItemA, nodeItemB, nodeItemC);
TreeItem<String> nodeItemCA = new TreeItem<>("Item CA");
TreeItem<String> nodeItemCB = new TreeItem<>("Item CB");
nodeItemC.getChildren().addAll(nodeItemCA, nodeItemCB);
TreeItem<String> nodeItemA1 = new TreeItem<>("Item A1");
TreeItem<String> nodeItemA2 = new TreeItem<>("Item A2");
TreeItem<String> nodeItemA3 = new TreeItem<>("Item A3");
nodeItemA.getChildren().addAll(nodeItemA1, nodeItemA2, nodeItemA3);
TreeView<String> treeView = new TreeView<>(treeItemRoot);
treeTab.setContent(treeView);
}
public static void main(String[] args) {
launch(args);
}
}
java.lang.RuntimeException: Error while creating node:class javafx.scene.layout.StackPane id:null
NODE INFORMATION
Node:StackPane@5bb0a705[styleClass=tree-disclosure-node] Class:class javafx.scene.layout.StackPane Id:null
Children:[StackPane@401249ef[styleClass=arrow]]
PARENT INFORMATION
Node:TreeViewSkin$1@72fac9c9[styleClass=cell indexed-cell tree-cell]'Root' Class:class com.sun.javafx.scene.control.skin.TreeViewSkin$1 Id:null
Children:[Text[text="Root", x=0.0, y=0.0, alignment=LEFT, origin=BASELINE, boundsType=LOGICAL_VERTICAL_CENTER, font=Font[name=System Regular, family=System, style=Regular, size=15.0], fontSmoothingType=LCD, fill=0x333333ff]]
at org.fxconnector.node.SVNodeFactory.createNode(SVNodeFactory.java:56)
at org.fxconnector.StageControllerImpl.createNode(StageControllerImpl.java:775)
at org.fxconnector.StageControllerImpl.lambda$new$10(StageControllerImpl.java:231)
at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
at javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
at javafx.collections.FXCollections$UnmodifiableObservableListImpl.lambda$new$62(FXCollections.java:929)
at javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
at com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164)
at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
at com.sun.javafx.collections.VetoableListDecorator.lambda$new$31(VetoableListDecorator.java:76)
at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
at javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
at javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
at javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
at javafx.collections.ObservableListBase.endChange(ObservableListBase.java:205)
at javafx.collections.ModifiableObservableListBase.remove(ModifiableObservableListBase.java:183)
at com.sun.javafx.collections.VetoableListDecorator.remove(VetoableListDecorator.java:332)
at com.sun.javafx.collections.VetoableListDecorator.remove(VetoableListDecorator.java:221)
at javafx.scene.Parent.impl_toBack(Parent.java:644)
at javafx.scene.Node.toBack(Node.java:1756)
at com.sun.javafx.scene.control.skin.TreeCellSkin.updateDisclosureNode(TreeCellSkin.java:186)
at com.sun.javafx.scene.control.skin.TreeCellSkin.layoutChildren(TreeCellSkin.java:211)
at javafx.scene.control.Control.layoutChildren(Control.java:578)
at javafx.scene.Parent.layout(Parent.java:1087)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Scene.doLayoutPass(Scene.java:552)
at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2397)
at com.sun.javafx.tk.Toolkit.lambda$runPulse$29(Toolkit.java:398)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:397)
at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:424)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:518)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:498)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:491)
at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$403(QuantumToolkit.java:319)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
at java.lang.Thread.run(Thread.java:748)
java.lang.RuntimeException: Error while creating node:class javafx.scene.layout.StackPane id:null
NODE INFORMATION
Node:StackPane@3fb4f2e2[styleClass=tree-disclosure-node] Class:class javafx.scene.layout.StackPane Id:null
Children:[StackPane@b52262b[styleClass=arrow]]
PARENT INFORMATION
Node:TreeViewSkin$1@330b4596[styleClass=cell indexed-cell tree-cell]'Item A' Class:class com.sun.javafx.scene.control.skin.TreeViewSkin$1 Id:null
Children:[Text[text="", x=0.0, y=0.0, alignment=LEFT, origin=BASELINE, boundsType=LOGICAL_VERTICAL_CENTER, font=Font[name=System Regular, family=System, style=Regular, size=15.0], fontSmoothingType=LCD, fill=0x333333ff]]
at org.fxconnector.node.SVNodeFactory.createNode(SVNodeFactory.java:56)
at org.fxconnector.StageControllerImpl.createNode(StageControllerImpl.java:775)
at org.fxconnector.StageControllerImpl.lambda$new$10(StageControllerImpl.java:231)
at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
at javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
at javafx.collections.FXCollections$UnmodifiableObservableListImpl.lambda$new$62(FXCollections.java:929)
at javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
at com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164)
at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
at com.sun.javafx.collections.VetoableListDecorator.lambda$new$31(VetoableListDecorator.java:76)
at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
at javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
at javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
at javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
at javafx.collections.ObservableListBase.endChange(ObservableListBase.java:205)
at javafx.collections.ModifiableObservableListBase.remove(ModifiableObservableListBase.java:183)
at com.sun.javafx.collections.VetoableListDecorator.remove(VetoableListDecorator.java:332)
at com.sun.javafx.collections.VetoableListDecorator.remove(VetoableListDecorator.java:221)
at javafx.scene.Parent.impl_toBack(Parent.java:644)
at javafx.scene.Node.toBack(Node.java:1756)
at com.sun.javafx.scene.control.skin.TreeCellSkin.updateDisclosureNode(TreeCellSkin.java:186)
at com.sun.javafx.scene.control.skin.TreeCellSkin.layoutChildren(TreeCellSkin.java:211)
at javafx.scene.control.Control.layoutChildren(Control.java:578)
at javafx.scene.Parent.layout(Parent.java:1087)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Scene.doLayoutPass(Scene.java:552)
at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2397)
at com.sun.javafx.tk.Toolkit.lambda$runPulse$29(Toolkit.java:398)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:397)
at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:424)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:518)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:498)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:491)
at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$403(QuantumToolkit.java:319)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
at java.lang.Thread.run(Thread.java:748)
java.lang.RuntimeException: Error while creating node:class javafx.scene.layout.StackPane id:null
NODE INFORMATION
Node:StackPane@4a2a9995[styleClass=tree-disclosure-node] Class:class javafx.scene.layout.StackPane Id:null
Children:[StackPane@5483de69[styleClass=arrow]]
PARENT INFORMATION
Node:TreeViewSkin$1@269becf3[styleClass=cell indexed-cell tree-cell]'Item C' Class:class com.sun.javafx.scene.control.skin.TreeViewSkin$1 Id:null
Children:[Text[text="", x=0.0, y=0.0, alignment=LEFT, origin=BASELINE, boundsType=LOGICAL_VERTICAL_CENTER, font=Font[name=System Regular, family=System, style=Regular, size=15.0], fontSmoothingType=LCD, fill=0x333333ff]]
at org.fxconnector.node.SVNodeFactory.createNode(SVNodeFactory.java:56)
at org.fxconnector.StageControllerImpl.createNode(StageControllerImpl.java:775)
at org.fxconnector.StageControllerImpl.lambda$new$10(StageControllerImpl.java:231)
at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
at javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
at javafx.collections.FXCollections$UnmodifiableObservableListImpl.lambda$new$62(FXCollections.java:929)
at javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
at com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164)
at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
at com.sun.javafx.collections.VetoableListDecorator.lambda$new$31(VetoableListDecorator.java:76)
at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
at javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
at javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
at javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
at javafx.collections.ObservableListBase.endChange(ObservableListBase.java:205)
at javafx.collections.ModifiableObservableListBase.remove(ModifiableObservableListBase.java:183)
at com.sun.javafx.collections.VetoableListDecorator.remove(VetoableListDecorator.java:332)
at com.sun.javafx.collections.VetoableListDecorator.remove(VetoableListDecorator.java:221)
at javafx.scene.Parent.impl_toBack(Parent.java:644)
at javafx.scene.Node.toBack(Node.java:1756)
at com.sun.javafx.scene.control.skin.TreeCellSkin.updateDisclosureNode(TreeCellSkin.java:186)
at com.sun.javafx.scene.control.skin.TreeCellSkin.layoutChildren(TreeCellSkin.java:211)
at javafx.scene.control.Control.layoutChildren(Control.java:578)
at javafx.scene.Parent.layout(Parent.java:1087)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Parent.layout(Parent.java:1093)
at javafx.scene.Scene.doLayoutPass(Scene.java:552)
at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2397)
at com.sun.javafx.tk.Toolkit.lambda$runPulse$29(Toolkit.java:398)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:397)
at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:424)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:518)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:498)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:491)
at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$403(QuantumToolkit.java:319)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
at java.lang.Thread.run(Thread.java:748)
最佳答案
我也遇到了这个,所以我会把@jimbo8 的评论作为答案:
这是由 ScenicView 引起的.
关闭 ScenicView,您将不会再收到此错误。
关于JavaFX TreeView java.lang.RuntimeException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49316378/
我真的很难弄明白这一点。当我查看 logcat 指向错误的位置时,它指向这一行: throw new RuntimeException(i); 在里面 public void onDetach() {
@Transactional (noRollbackFor=RuntimeException.class) public void methodA (Entity e){ service.met
我正在开发简历应用程序并遇到以下异常 在gradle文件上,我尝试了所有可能的解决方案,使缓存重启无效,并且干净的gradle不起作用 java.lang.RuntimeException:java.
我的项目在 Android Studio 3.0.1 上的 Whatchap 中,这是我的设计 gradle。build.gradle(应用程序) 应用插件:'com.android.applicat
// Top-level build file where you can add configuration options common to all sub-projects/modules.
您好,目前我正在开发包括解析服务器的项目,并且在将解析库添加到我的项目后,当我运行它时,它显示此错误,任务“:app:checkDebugDuplicateClasses”执行失败。 Exec
我找到了 another post显示我们如何创建我们自己的检查异常,它也返回不同于 500 的 HTTP 状态代码。但是,我需要它是一个 RuntimeException。然后,我找到了WebApp
我尝试在 7.40 系统上演示具有动态方法名称的 CALL METHOD 语句。我使用下面的测试代码,在第 27 行得到一个 ABAP 运行时错误。异常描述中的错误分析状态 ... 在类 LCL 中,
我的ViewModel类抛出了RunTimeException。它基本上不能创建ViewModel类的实例。这是堆栈跟踪: 2019-05-29 01:27:56.700 9698-9698/com.
我安装了Hive 0.9.0,运行它时出现错误: ./hive Logging initialized using configuration in jar:file:/usr/lib/hive-0.
当我尝试在 android 4.1.1(galaxy nexus)上运行 opencv(2.4.2) sample3时。我收到RuntimeException。 Logcat指向此处:(android
Java中除了RuntimeException之外还有其他可能发生的异常吗?谢谢。 最佳答案 是的,有三种种。 检查异常 编译器会让您知道何时可以抛出它们,很可能是由于环境中的故障。 如果程序可以
这个问题已经有答案了: Why runtime exception is unchecked exception? (5 个回答) 已关闭 7 年前。 我知道受检查的异常继承自 Exception并且
这里发生了什么? 为什么 IOException (RemoteException) 的检查子级会转换为 RuntimeException? 摘自here的片段 import java.rmi.Rem
源代码(osmand)没有错误 我使用了 eclipse 和 sdk 模拟器 2.2,从 googlecode checkout (osmand应用程序) 我的代码: public void onCr
我开始研究线程,我不明白为什么下面的简单代码不起作用。它正在抛出: RuntimeException: can't create handler inside thread that has not
我想为自己破例。但是当我抛出异常时,程序就关闭了。那么我怎样才能运行我的方法3次然后关闭程序呢? (我的程序在intArray之后关闭,但我想遍历dobleArray和charArray) 这是我的异
我有一个扩展 HttpServlet 的类包含以下两个方法。当客户端向 Tomcat 服务器上运行的 Web 应用程序发出请求时,http 请求将通过此类处理,但是如果 doSomething 方法抛
在很多地方,我都会遇到几个检查异常,例如 IOException、ParseException、JSONException 等。我必须做出两个选择 - 通过在方法签名末尾添加 throws 来引发相同
RuntimeExceptions 应该指示编程错误,我希望我的应用程序在我的可观察对象中的某些东西抛出 RuntimeException 时崩溃。 最好的方法是什么?现在我正在考虑这个解决方案(它是
我是一名优秀的程序员,十分优秀!