wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes SWT TableColumn - SWTError - Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "SWT TableColumn - SWTError - "Cannot set text"" Watch "SWT TableColumn - SWTError - "Cannot set text"" New topic
Author

SWT TableColumn - SWTError - "Cannot set text"

Jay Damon
Ranch Hand

Joined: Jul 31, 2001
Posts: 282
I recently encountered a scenario where attempting to set the text for an SWT TableColumn widget fails with an InvocationTargetException / SWTError and the message "Cannot set text". There is nothing special about the column text, i.e. no special characters or mnemonics. It just fails. The same code works for other scenarios.

I took a look at the SWT source for the TableColumn class and found only one place where the "Cannot set text" error is thrown - see code fragment below - but I cannot see why I should have encountered a problem.

Any suggestions as to what the problem may be would be appreciated. Thanks!

Jay Damon
Ranch Hand

Joined: Jul 31, 2001
Posts: 282
I think I have found the problem. After performing additional testing, this appears to be a "No more handles" issue although that was NOT the exception message I received initially. Apparently SWT imposes a hard limit that only allows SWT widgets to be nested up to 50 deep. Adding an additional widget, regardless of type, triggers a "No more handles" exception.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SWT TableColumn - SWTError - "Cannot set text"