Swing layout 會自動的調整元件的大小, 不同的 layout 調整大小時所遵照的規則有所不同, 整理如下:
BoxLayout: requested maximum sizes
FlowLayout: preferred sizes
BorderLayout: preferred sizes
GridLayout: Each component takes all the available space within its cell, and each cell is exactly the same size
GridBagLayout: preferred sizes
沒有留言:
張貼留言