netbeans:NetBeans Platform Porting Tutorial

  To follow this tutorial, you need the software and resources listed in the following table.

Software or Resource Version Required
NetBeans IDE version version 6.1 or

  version 6.0
Java Developer Kit (JDK) version 6 or

  version 5
Download the Sample

Introduction to Porting  Before beginning this procedure, it makes sense to ask why _disibledevent="NetBeans Platform Porting Tutorial" />

  As shown above, you need to put the modules in a module suite. Then a dependency in the plugin module on the API module, using the Libraries panel in the plugin module's Project Properties dialog box. The size of each module, i.e., when one should create a module or continue developing within an existing one, is a question of debate. Smaller is better, in general.

  Always keep reevaluating what you really need to port. Look at the NetBeans Platform and decide where there is overlap with your own application. Where there is overlap, such as the menu bar and About box, decide what you want to do. Typically, you want to leverage as much as possible from the NetBeans Platform. Therefore, you would port as little as possible from your own application, while keeping as much of it as is useful to you.

  Move distinct parts of your user erface to one or more TopComponents. On the NetBeans Platform, the TopComponent provides the top level Swing container. In effect, it is a window. Move the user erface from your original application to one or more of these windows and discard your original JFrames.

  Copy the Java es that do not provide user erface elements. We simply copied the original WordLibrary.java . You can do the same with the model of your own Swing applications. You might need to tweak some code to smoothen the transition between the old Swing application and the NetBeans Platform application, but (as in the shown in this tutorial) this might not even be necessary.

Tags:  netbeanside6.5 netbeanside netbeans6.5 netbeans

延伸阅读

最新评论

发表评论