gpt4 book ai didi

java - SWT Composite 构造函数在非空参数上抛出 IllegalArgumentException

转载 作者:行者123 更新时间:2023-12-02 00:51:28 25 4
gpt4 key购买 nike

这段代码(Scala)

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

抛出异常:

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)

根据documentationIllegalArgumentException 仅当父级为 null 时才抛出,但我正在检查这一点。 detailsPane 是一个CTabFolder。为什么会发生这种情况?

最佳答案

给出的解决方案at the Eclipse forums : detailsPane 结果被处置了。

关于java - SWT Composite 构造函数在非空参数上抛出 IllegalArgumentException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2854899/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com