views:

35

answers:

2

Using JForm Designer I am trying to change the class of a JPanel in the properties window from JPanel to various custom classes, all of which subclass JPanel.

Sometimes it works, sometimes it fails with the message:

panel1: Can not morph non-toplevel component to non-visual bean.

What is a non-visual bean? Why are some of my subclasses recognized as visual vs. non-visual beans?

+1  A: 

On this IBM site it says:

Non-visual beans You can use the non-visual beans to build Java™ and

Web client applications that require a customized user interface. The non-visual beans support the standard bean programming model by providing default constructors, properties, events and a serializable interface. You can use the non-visual beans in builder tools that support introspection.

Visual beans The visual beans are customizable, Swing-based, graphical

user interface components. Use the visual beans to build Java applications for Windows®. You can place them within windows and dialogs of Java-based applications. Because the visual beans are built using the non-visual beans (as a data model), you must use them in conjunction with the non-visual beans when building an application.

Kyra
I'm looking for a more formal definition. My class is a customizable, swing-based, graphical UI component. This sounds like they're saying a visual bean is any JavaBean which derives from a visual Swing component? But I'm doing this! There must be something more to it.
Tom Tresansky
A: 

The JForm Designer documentation has been updated.

It now says explicitly that Visual Beans must inherit from java.awt.Component.

I guess that's the all of it.

Tom Tresansky