0
這段代碼(Scala中)SWT複合構造拋出:IllegalArgumentException - 在非空參數
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)
按照documentation,IllegalArgumentException
應該只被拋出當父母是null
,但我正在檢查。 detailsPane
是CTabFolder
。爲什麼會發生?
我並沒有將其標記爲斯卡拉,因爲我認爲這是一個純粹的SWT的問題(這被證明是正確的)。 – 2010-05-18 09:33:54