What is a non-visual bean?
Usin开发者_运维百科g 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?
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.
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.
精彩评论