如何从 Netbeans 平台中的另一个窗口更新一个窗口中的组件?
我对 Netbeans 平台还很陌生。这就是我想要做的,我有两个窗口,一个是“编辑器”主窗口,第二个是“资源管理器”窗口,其中包含 JTree 组件。每次我向数据库添加一个新项目时,我都想向资源管理器窗口中的 JTree 组件添加一个节点!我试图找到一种从主窗口调用更新程序方法的方法,但到目前为止还没有成功!两个窗口位于同一模块和同一包中!我有办法做到这一点吗?
I'm fairly new to Netbeans Platform. Here is what I'm trying to do, I have two windows, one is the main window which is 'editor' and the second one is an 'explorer' window with a JTree component in it. Every time I add a new Item to my database, I want to add a node to the JTree component in explorer window ! I was trying to find a way to call an updater method from the main window, but so far no luck ! both windows are located in the same module and the same package ! is there a way I can do that ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 NetBeans 平台应用程序中,您使用 Lookup API 在 TopComponents/模块之间进行通信。
http://netbeans.dzone.com/news/top-10 -netbeans-apis-part-2
http://netbeans.org/kb/trails/platform.html
我还建议阅读 NetBeans 平台书籍以获取基础知识。
In NetBeans Platform applications you use the Lookup API do communicate between TopComponents/ modules.
http://netbeans.dzone.com/news/top-10-netbeans-apis-part-2
http://netbeans.org/kb/trails/platform.html
I also recommend to read a NetBeans Platform book to get the basics.