cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

DevFaqWindowsComponentHowTo

Revision as of 16:05, 6 November 2009 by Admin (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)

I want to show my own component(s) in the main window - where do I start?

Use File -> New File wizard, Module Development category and Window Component item. It will generate all necessary background code for you and open GUI Builder to design UI of your own component.

But what is behind the scenes, created by wizard?

  • Subclass of TopComponent is created. Design it just as you would a JPanel.
  • Simple subclass of javax.swing.AbstractAction in created and added to main menu. It's implemented it to open your component like follows:
public class MyAction extends AbstractAction {
   public MyAction() {
      putValue (Action.NAME, "Open My Component");
   }

   public void actionPerformed(ActionEvent ae) {
      new MyComponent().open();
   }
}

TopComponents are part of the Windows API.