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.
- Select one or more components in the Form Workspace, or in the Components tree view.
- On the context menu of the selection, choose Surround with, or press Ctrl+Alt+TCtrl+Alt+TCtrl+Alt+TCtrl+Alt+TCtrl+Alt+TCtrl+Alt+T or Ctrl+Shift+CCtrl+Alt+TCtrl+Alt+TShift+Alt+Z or Ctrl+Alt+TAlt Command TAlt Command TAlt Command Z.
- In the Surround With popup menu, click the desired container, or press the corresponding numeric
When reasonable, IntelliJ IDEA smartly suggests you to wrap 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:
- Right-click container node in the Components tree view.
- On the context menu, choose