Adding a TopComponent Window Walkthrough

Reviewing Dependencies

The creation of a window module requires two INT modules that are part of the INTViewer platform:

  • IntviewerCore
  • Utilities API (provided with Netbeans)

See the list of INTViewer modules to load the INTViewer platform and for a description of each module.

The window created will be a NetBeans "TopComponent" that is meant to be along the desktop area. For a window inside the desktop area, follow this other tutorial.

Creating your module template using NetBeans wizard

  • Click File -> New Project
  • In the New Project wizard select NetBeans Modules from the Categories list and Module from the Projects list and click Next >
  • For Project Name, specify mydemowindowmodule
  • Select option Standalone Module and make sure to specify the INTViewer platform in the NetBeans Platform field.

  • Click Next > and specify com.mycompany.myviewer.mydemowindowmodule for the Code Name Base and MyDemoWindowModule for the Module Display Name.
  • Click on Finish

  • In the Projects tree view, you should see your project which includes a number of files that have been created for you.

Configuring your Module

  • In the Projects tree, right click on the module MyDemoWindowModule and select Properties from the list.
  • Under Categories, select Libraries.
  • Select Java plaform JDK1.7 . If you don't see this option, you will need to install jdk1.7 and load it into NetBeans using option Tools->Java Platforms
  • Click on the Add button next to Module Dependencies
  • In the list, select IntviewerCore and click OK.
  • Click Add again,select Utilities API and click OK.
  • Click OK in Project Properties Dialog

Creating your Window Component

  • In the Projects tree view, expand the Source Packages tree.
  • Right click on MyDemoWindowModule and select New->Window Component...
  • In the wizard, select tools for the Window Position (window positions are explained here)
  • DO NOT CHECK ANY OF THE OTHER TOGGLES AT THIS STAGE
  • Select Next >

  • Specify MyDemoWindow for the Class Name Prefix and select com.mycompany.myviewer.mydemowindowmodule as Package.
  • Click Finish.
  • The Wizard creates a number of files and opens automically the MyDemoWindowTopComponent.java file in Design mode.

Running your Window Component

Click the green arrow in the Netbeans toolbar to run your customized INTViewer. Your component should be available from the Window menu of your customized INTViewer.