Adding a Label and Setting Its Properties

Your application uses a blank label with an opaque background to display the colors. You need to add the label and set its properties.

To add a label:

  1. Click the Swing tab on the component palette.

  2. In the Swing pane, click the JLabel button.

  3. Click anywhere in the Form Editor window.

    A label with the text jLabel1 is displayed in the Form Editor. In the Component Inspector, a node named jLabel1 [JLabel] is displayed (and highlighted) in the tree view and the properties for the component are displayed in the Properties pane. Source code for the label is displayed in the Source Editor.

  4. Scroll to the opaque property in the Properties pane.

  5. Select its default value (False) and choose True from the combo box.

  6. In the text property field, delete jLabel1 (leaving the value blank) and press Enter.

Next:Adding a Button
Back:Choosing a Layout Manager

Legal Notices