简体   繁体   中英

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)

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 :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM