javaswingbeans-binding

How to call Bean classes not in default package


Netbeans IDE supports beansbinding and we can call easily a bean in the default package (without instantiating beans can be seen in the Inspector).

But if our UI components (swing) is in another package, and beans are in another package, we have to instantiate those beans in our components (JFrame or JPanel) with getters (and setters). I want to know that, is there a way to call beans without instantiating in our components in NetBeans(Just select the source from the bind property box). (Then we can see those beans in the Inspector of the relevant component (JFrame or JPanel).) In other words, is there a way to place our beans classes in the Inspector.(if our JFrame is in default package and bean is also in Default package, then we can click the bean icon from the pallet and give the relavant bean class,Then we can see that bean class in the Inspector)


Solution

  • You can just drag the class on the Projects window to the JPanel you want to put in. It will appear in Inspector.

    (If I understand the question :)