Creating a Window Component
See Also
A window component creates a window (also known as 'view') for a module. The IDE
provides the Window Component wizard to simplify the initial creation process.
To create a new window component:
- Right-click a module project and choose New > Window Component.
- In the Basic Settings page, you set the following:
- Window Position. Specifies the location of the window component when open in the IDE.
Depending on the modules installed
in the platform that forms the basis
of your application, you're able
to choose from several window positions,
including the following:
- bottomSlidingSide. The window component will be available as a button
on the bottom bar of the IDE.
- commonpalette. The default position of the IDE's Palette for HTML/JSP code snippets.
- debugger. The default position of the IDE's Debugger.
- editor. The default position of the IDE's Source Editor.
- explorer. The default position of the IDE's Projects window.
- leftSlidingSide. The window component will be available as a button
on the left sidebar of the IDE.
- navigator. The default position of the IDE's Navigator.
- output. The default position of the IDE's Output window.
- properties. The default position of the IDE's Properties window.
- rightSlidingSide. The window component will be available as a button
on the right side of the Source Editor.
- Open on Application Start. Specifies whether the window component is open
by default or not.
- Keep preferred size when slided-in. Specifies that the size of the
window when minimized will be determined by the preferred size propery of the
window. When selected, the following line is added
to the TopComponent's constructor:
putClientProperty("netbeans.winsys.tc.keep_preferred_size_when_slided_in", Boolean.TRUE);
- Sliding not allowed.
Closing not allowed.
Undocking not allowed.
Dragging not allowed.
Maximization not allowed. Specify that the window
should not have one or more features that it
has by default.
- In the Name, Icon, and Location page, you have to set the following:
- Class Name. Specifies the name of the new Action and TopComponent classes.
- Icon. Specifies the icon that will accompany the window component. For example, you
will see the icon in the label of the window component. (Optional)
- Package. Specifies the name of the package where the class will be housed.
- After completing the wizard, you can do one or more of the following:
- Use the Form editor to design the window.
- Place the window component in a different position. In the layer.xml file,
tweak the Modes section.
- Add your own code to componentOpened() and componentClosed() to
specify what will happen when the window opens and closes.
- See Also
- About NetBeans Platform and Module Development
- About the NetBeans Platform
Legal Notices