Re: Launching JFrame Outside NetBeans Window
Wade Chandler <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.user-interface |
|---|---|
| Message-ID | <[email protected]> |
--- ccocco <[email protected]> wrote: > > Hi, I'm interested in using NetBeans for the mere > purpose of modularizing and > bundling my existing Java source code. I may > eventually incorporate some of > the features of the NetBeans Platform, but for now, > I'd just like to just > use it to build my application as a distributable > .exe. I have my own > JFrame that I'd like to launch and I do not want to > have to use the > TopComponent or Windowing API to do so. I cannot > find an easy way to do > this. Can anyone tell me how to specify my own > JFrame class as the one to > launch when I create a Module Suite, Module Project, > and Module Wrapper > Library around my exixting code? I'd like to use > the "Build Distribution > ZIP" feature to create the launch executable, which > should in turn launch my > JFrame, not the default NetBeans main window. In the future please ask questions related to the Netbeans Platform on the [email protected] mailing list and regular user questions on [email protected] as this list (nbui) is purely devoted to improving the user interface of the IDE and Platform specifically and not to user support. On with your question for now (please reply on nbusers or openide): You can visit: http://dvbcentral.sourceforge.net/netbeans-runtime.html for an example of how to use the module system independently: it doesn't have a Window or UI at all I believe. You can also create your own WindowManager replacement and register it. You can then make your window be the main window and do what ever you want. You do not have to use all the features the Platform provides. I do not have an example of doing this handy, but it is suppose to be possible. You will not however get the benefits of the layer.xml UI registration doing this. You can see: http://wiki.netbeans.org/wiki/view/DevFaqWindowsInternals for more information and: http://wiki.netbeans.org/wiki/view/NetBeansDeveloperFAQ#section-NetBeansDeveloperFAQ-WindowSystem for possibly more. It might be easier to look at your current application then look at replacing the Tab container in the middle of the application and adding your main UI to this replacement. You then gain your menu registration etc without having to write all that code custom. You would then move your event handlers for menus into actions. It just depends on what you find will be easier really. Wade ================== Wade Chandler Software Engineer and Developer Netbeans Community and Dream Team Member: http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam Check out Netbeans at: http://www.netbeans.org