Text components are available for simple text and for enhanced text and editing panes. VisualAge provides text beans from Swing and AWT packages. Basic text beans from the Abstract Windowing Toolkit (AWT) are provided in the Java class libraries project, in the java.awt package. Enhanced text beans from the Java Foundation Classes (JFC) library are provided in the JFC class libraries project, in the com.sun.java.swing and com.sun.java.swing.text packages. Although Swing and AWT beans can be mixed, it is inadvisable.
The following beans provide simple text components:
Bean | Description |
---|---|
JLabel or Label | A label, usually to identify another component |
JPasswordField | A text field for sensitive data |
JTextArea or TextArea | A multiline text area |
JTextField or TextField | A single-line text field |
Adding a Text Component
Pane and Panel Beans
Beans for Visual Composition