Java Reference
In-Depth Information
Figure 10-2. FlowLayout with three different alignments
You can specify the gaps, in pixels, for the spacing between components, both horizontal
( hgap ) and vertical ( vgap ). Gaps default to five pixels unless specified. It is possible to specify
negative gaps if you want components to be placed on top of one another.
BorderLayout Class
BorderLayout is the default layout manager for the content pane of a JFrame , JWindow , JDialog ,
JInternalFrame , and JApplet . It provides for a more flexible way of positioning components
along the edges of the window. Figure 10-3 shows a typical BorderLayout .
Figure 10-3. Sample BorderLayout
 
Search WWH ::




Custom Search