SWT Composite consructor throws IllegalArgumentException on a non-null argument

Posted by Alexey Romanov on Stack Overflow See other posts from Stack Overflow or by Alexey Romanov
Published on 2010-05-18T06:13:31Z Indexed on 2010/05/18 6:20 UTC
Read the original article Hit count: 296

Filed under:
|

This piece of code (in 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. detailsPane is a CTabFolder. Can anybody say why this could happen?

© Stack Overflow or respective owner

Related posts about swt

Related posts about java