my dog learned polymorphism*
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
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "SWT TableColumn - SWTError - "Cannot set text"" Watch "SWT TableColumn - SWTError - "Cannot set text"" New topic

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.
subject: SWT TableColumn - SWTError - "Cannot set text"
Similar Threads
My download app got problems CPU 99
Casting Problem
JTable and Custom Columns
inconvertible types found : int required: java.lang.Short
Selecting entire column