简体   繁体   中英

What is the Horizontal and Vertical spacer in the IntelliJ Swing form?

Every time I drag a component to the JPanel , it will automatically add the horizontal spacer and vertical spacer, I don't know what it is.

What is the Horizontal and Vertical spacer in the IntelliJ Swing form?

The spacers are added so that the component does not take the entire space of the form. The IntelliJ IDEA UI designer uses the grid layout by default, and each component occupies the entirety of one or more grid cells. Without the spacers, there would be only one grid cell, and the component would occupy all of it, which is usually not what you want.

If you have multiple components that together need to occupy the entire space of the form, you can delete the spacers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM