[英]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
. detailsPane
是CTabFolder
。 Why this could happen? 为什么会发生这种情况?
在Eclipse论坛上给出的解决方案: detailsPane
被detailsPane
。
Did you check if the widget is disposed? 您是否检查了小部件是否已丢弃?
EDIT: did not see you answer there ;) 编辑:没看到你在那里回答;)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.