About XYLayout:If one of the nested panels in your UI has XYLayout, then that panel's preferredSize is determined by the layout's setWidth() and setHeight() calls, and that is the value used for the panel in computing the preferredSize of the next outer container. For example, in the default Application wizard application, the nested panel occupying the center of the frame's BorderLayout is itself initially in XYLayout and is set to size 400 x 300. This has a significant effect on the overall size of the frame when it is packed, because the nested panel report its preferredSize to be 400x300. The overall frame will be that plus the sizes necessary to satisfy the other components around it in the BorderLayout of the frame.
GridLayout:GridLayout places components in a grid of cells that are in rows and columns. GridLayout expands each component to fill the available space within its cell. Each cell is exactly the same size and the grid is uniform. When you resize a GridLayout container, GridLayout changes the cell size so the cells are as large as possible, given the space available to the container. GridLayout example Use GridLayout if you are designing a container where you want the components to be of equal size, for example, a number pad or a toolbar.
Sun的,你可以查看LayoutManager接口下的实现类,有所有的布局。