You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Sean Carrick <se...@pekinsoft.com> on 2022/11/05 01:27:14 UTC

Dropping Beans on the GUI Designer

Hey All!

I have a quick question regarding dropping Beans on the GUI Designer in
NetBeans:

In NB 8.2 and prior, I was able to select a Bean from the Palette window
and enter an interface, such as "java.util.List", then drop that Bean on
the designer. Once I did that, I could specify the type parameter in the
properties window for that Bean (List, in this case).

However, starting in NB 9, this is no longer possible. I have attempted
this with each release since then and that feature seems to have been lost
to time, as I get an error message stating:

> Cannot instantiate java.util.List as a JavaBeans component.
>
A usual cause of this error is that the class is abstract or does not have
> a public constructor with no parameters.
>
This exact message (or a derivative thereof) has been the only result in
each version since 9.

While I understand what this error message is stating, it does not allow
for following the coding *best practice* of declaring fields and variables
by their well-defined interface.

Is there any way to get NB to allow dropping interfaces as Beans in the GUI
Designer again so that my fields can be defined by their interface, for
those times when I need to change the implementation during the course of
the window's run?

The main reason that I like being able to do this is because I have the old
BeansBinding Support for Form Editor plugin installed, but cannot use it
due to not being able to declare a List field from within the visual
designer. Simply declaring the List in the code editor does not allow the
BeansBinding support to see it, so it cannot be used to bind, for example,
a JTable to a List.

Thank you for any pointers that you can give. They are greatly appreciated.

Sincerely,

Sean Carrick
Owner - PekinSOFT Systems
sean@pekinsoft.com
(309) 989-0672