简体   繁体   English

SWT Composite构造函数在非null参数上引发IllegalArgumentException

[英]SWT Composite constructor throws IllegalArgumentException on a non-null argument

This piece of code (in Scala) 这段代码(在Scala中)

val contents = {
  assert(mainWindow.detailsPane != null)
  new Composite(mainWindow.detailsPane, SWT.NONE)
}

throws an exception: 引发异常:

Exception occurred
java.lang.IllegalArgumentException: Argument not valid
    at org.eclipse.swt.SWT.error(Unknown Source)
    at org.eclipse.swt.SWT.error(Unknown Source)
    at org.eclipse.swt.SWT.error(Unknown Source)
    at org.eclipse.swt.widgets.Widget.error(Unknown Source)
    at org.eclipse.swt.widgets.Widget.checkParent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.<init>(Unknown Source)
    at org.eclipse.swt.widgets.Control.<init>(Unknown Source)
    at org.eclipse.swt.widgets.Scrollable.<init>(Unknown Source)
    at org.eclipse.swt.widgets.Composite.<init>(Unknown Source)
    at main.scala.NodeViewPresenter$NodeViewImpl.<init>(NodeViewPresenter.scala:41)

According to the documentation , IllegalArgumentException should only be thrown when the parent is null , but I am checking for that. 根据文档 ,仅当父级为null时才应抛出IllegalArgumentException ,但我正在检查这一点。 detailsPane is a CTabFolder . detailsPaneCTabFolder Why this could happen? 为什么会发生这种情况?

在Eclipse论坛上给出的解决方案: detailsPanedetailsPane

Did you check if the widget is disposed? 您是否检查了小部件是否已丢弃?

EDIT: did not see you answer there ;) 编辑:没看到你在那里回答;)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 IllegalArgumentException:图像必须是非空的 - IllegalArgumentException : image must be non-null Java swt IllegalArgumentException:参数不能为null - Java swt IllegalArgumentException: Argument cannot be null SWT java.lang.IllegalArgumentException:参数不能为null - SWT java.lang.IllegalArgumentException: Argument cannot be null SWT:合成内的图像; 获取IllegalArgumentException - SWT: Image inside Composite; Getting IllegalArgumentException 错误:java.lang.IllegalArgumentException:指定为非null的参数为空Firebase事务Kotlin - Error: java.lang.IllegalArgumentException: Parameter specified as non-null is null firebase transaction kotlin 由java.lang.IllegalArgumentException引起的指定为非null的参数为null - Parameter specified as non-null is null caused by java.lang.IllegalArgumentException java.lang.IllegalArgumentException:指定为非空的参数是 null:- android,应用程序启动但立即崩溃 - java.lang.IllegalArgumentException: Parameter specified as non-null is null: - android, app starting but crashing straight away java.lang.IllegalArgumentException:指定为非空的参数是 Java 代码中的 null 错误 - java.lang.IllegalArgumentException: Parameter specified as non-null is null error in Java code java.lang.IllegalArgumentException:纹理必须为非空(CanvasJs 和 JavaFX) - java.lang.IllegalArgumentException: Texture must be non-null (CanvasJs and JavaFX) java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull - java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM