Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Composite consructor throws IllegalArgumentException on a non-null argument
icon9.gif  Composite consructor throws IllegalArgumentException on a non-null argument [message #534115] Tue, 18 May 2010 03:03 Go to next message
Eclipse UserFriend

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. (As I understand from examples, the controls I want to set as contents of CTabItem should be children of the CTabFolder.) Can anybody say why this could happen?

[Updated on: Tue, 18 May 2010 03:09] by Moderator

Re: Composite consructor throws IllegalArgumentException on a non-null argument [message #534130 is a reply to message #534115] Tue, 18 May 2010 04:11 Go to previous messageGo to next message
Eclipse UserFriend
May be u r CTabFolder is disposed...

check by putting a break point and add watch argument
mainWindow.detailsPane.isDisposed()
Re: Composite consructor throws IllegalArgumentException on a non-null argument [message #534134 is a reply to message #534130] Tue, 18 May 2010 04:16 Go to previous message
Eclipse UserFriend
Thank you! This was correct.
Previous Topic:Combo: how to get rid of the 3d bar
Next Topic:CCombo: dropdown seems to be a little too "autonomous"
Goto Forum:
  


Current Time: Sun Jul 20 08:13:35 EDT 2025

Powered by FUDForum. Page generated in 0.05116 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top