created: 07/27/99; revised: 01/27/00

CHAPTER 61 --- Component Layout Techniques

This chapter discusses how you can have more control over where GUI components are placed in a frame. In our work with GUI programming, components have been placed into the frame using the FlowLayout layout manager. As components are added to the frame they are placed in raster order--- left to right top to bottom. If the frame is the right size for the components this results in a pretty good layout.

But with the wrong size frame, components will be laid out poorly. For example, labels may be separated from the component they label. This chapter discusses ways to improve the layout of an interface: how to prevent the user from altering the size of a frame, how to use Panels to group components together, and how to use the GridLayout layout manager.

Chapter Topics:

  • setResizable() method for Frames.
  • Panels.
  • Adding components to a Panel.
  • Adding Panels to a Frame.
  • The GridLayout layout manager.
  • Arranging Panels in a grid.

QUESTION 1:

Can the user sometimes change the size of a frame?

Click Here after you have answered the question