What should I do if I encounter an InstantiationException using a custom widget?
An InstantiationException means that Designer could not create an instance of a particular class. The most common reason for this is that the component is not a valid Swing widget or SWT widget. In order to be a valid Swing widget, a class must be a valid Java bean and have a public, zero-argument constructor. SWT widgets must have a public two-argument constructor with parent and style bits as the two arguments. To fix the problem, add the missing constructor. Another possible cause for this exception is some other failure in the initialization code of the component. A component may rely on some runtime behavior that is not possible at design time (such as accessing an application database or some other file). Runtime specific behavior should be isolated (and stubbed out as necessary) by wrappering the runtime specific code with a call to Beans.isDesignTime() which will answer true when the component is loaded within Designer and false at runtime. More detail about the use of custom w