About the visual editor for Java

The visual editor for Java is a code-centric Java editor that helps you design applications that have a graphical user interface (GUI). The visual editor is based on the JavaBeans component model and supports visual construction using the Standard Widget Toolkit (SWT), the Abstract Window Toolkit (AWT), or Swing.

The visual editor is designed to work with .java source files, letting you edit the source and the design simultaneously. The visual editor does not have its own perspective. If you use the visual editor in the Java perspective, the visual editor for Java uses any customization that you have made to the position of the Tasks view, the Console view and the Outline view.

You can use the visual editor for Java to create a class using visual components, or Java beans, from a design palette. This class can be an executable application (a class with a main method) or it can be a Java bean that you intend to include in another class. To be used as a Java bean by the visual editor for Java there is no interface that must be implemented and the only requirement is that the editor knows how to instantiate the class. For most purposes this means that the class should be public and have a public null constructor. The null constructor can be explicit or implicit, although there are a few exceptions that the visual editor for Java recognizes, such as java.awt.Dialog subclasses. They are instantiated using the constructor that takes an argument of java.awt.Frame. The visual editor adds an explicit constructor that calls the initialize method, which is used to set up the initial state of the Java bean.

The workbench has a number of editors that can be used to edit a .java source file. The Java Editor lets you write your source manually, while the visual editor for Java combines a Source view with a Design view where you can lay out and preview visual components.

Parent topic: Editing Java in the visual editor

(C) Copyright IBM Corporation 1999, 2004. All Rights Reserved.