IntelliJ IDEA 2024.1 Help

Wrapping/Unwrapping Components

The Surround With feature is available in the GUI Designer, as well is in the editor. In the GUI Designer, you can wrap a container of your choice around one or more components, and remove wrapping.

To wrap a container around components

  1. Select one or more components in the Form Workspace, or in the Components tree view.

  2. On the context menu of the selection, choose Surround with, or press Ctrl+Alt+T.

  3. In the Surround With popup menu, click the desired container, or press the corresponding numeric key.


When reasonable, IntelliJ IDEA smartly suggests wrapping a component into a container. This is done with the help of intention action. For example, IntelliJ IDEA suggests to wrap a JList into a JScrollPane:


To unwrap components from the surrounding container

  1. Right-click container node in the Components tree view.

  2. On the context menu, choose Flatten.

Last modified: 26 May 2024