Insert Component

Often it is necessary to add a component between components that are already placed in a form. Whenever you add a component between two existing components, the GUI Builder automatically shifts them to make room for the new component. To demonstrate this, we'll insert a JTextField component between the Title: and Nickname: components we added previously.


1. Insert a JTextField component between two JLabel components

* In the Palette window, select the JTextField component from the Swing Controls section.
* Move the cursor over the Title: and Nickname: JLabels on the second row such that the JTextField overlaps both and is aligned to their baselines.
* Observe that the Text Field component is inserted between the Title: and Nickname: Labels.
2. Add a Text Field component.

* Drag a new Text Field component and place it just beside Nickname: Label component.
* Extend the newly added Text Field component to the right edge of the Panel.
Good luck!!!

Comments

Juliawan said…
salam kenal sob :D,nice blog