Apache NetBeans Wiki Index

Note: These pages are being reviewed.

My TopComponent always opens in the editor area, but I want it to open in the same place as XYZ?

By default, TopComponent.open() opens all components in the central editor area of the main window. Overriding this is simple:

public MyTopComponent extends TopComponent {
  public void open() {
     Mode m = WindowManager.getDefault().findMode ("output");
     if (m != null) {

You need to know the ID of the Mode you want to put the component in. Common IDs are "output" for the bottom of the screen, and "explorer" for the left side. For other Modes, you may need to find a module that puts something there and read its layer files, or browse the System Filesystem.

Eventually you will probably want to specify what mode to dock your component into using the XML API for installing components, but the above technique works for simple modules, testing, etc.

Apache Migration Information

The content in this page was kindly donated by Oracle Corp. to the Apache Software Foundation.

This page was exported from http://wiki.netbeans.org/DevFaqWindowsOpenInMode , that was last modified by NetBeans user Admin on 2009-11-06T16:06:12Z.

NOTE: This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed.