Java Reference
In-Depth Information
We might be tempted to try to add our components directly into a BorderLayout ; however,
if the user should resize the screen, the object to the north and south will only stretch horizon-
tally—it is the object in the center that will stretch vertically. This could lead to an
awkward-looking screen, as demonstrated in Figure 8-24.
Figure 8-24. Resizing the GUI application if the table is in the north, the search panel is in the
center, and the booking panel is in the south
Note This is an example of where creating a sketch of our application before coding helps ensure we end
up with a GUI that the users want, not what is easiest for us. Without that sketch, we might be tempted to
change the user-approved design just to make our life easier.
So what we need to do is to change how we break up the GUI. The major amount of infor-
mation is going to be displayed in the table, so that is the component we want in the center.
This means that we are going to need to create another panel that will contain both search
options and booking options to go in the south of the main panel, as shown in Figure 8-25.
Figure 8-25. The new panels for the main window
Search WWH ::




Custom Search