What is the Window System?

The windowing system is what creates the main application window, and makes it possible to open components in the UI. The API for the windowing system is in the package The implementation of the windowing system is in the module ( in Mercurial repository, was core/windows in CVS).

The window system defines Modes which are places in the main window occupied by tabbed containers. TopComponents are GUI components (instances or subclasses of which can be put into these tabbed containers.

There is a programmatic API for creating/opening TopComponents - this is useful for testing components under development - just create an Action which calls new MyTopComponent().open() to quickly try out GUI components.

However, the main API modules use the declarative XML Window System API to install their components, for the following reasons:

  • Scalability: Components do not need to be created/deserialized unless they really need to be opened
  • Singletonization: You wouldn't want to have 5 Projects tabs in the IDE. Using the XML API correctly, you can easily refer to the singleton instance of your component once it's instantiated (almost) for free.
  • Persistence: The window system associates components with unique IDs; to properly persist your component across sessions, you need to use the XML APIs
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo