Java Reference
In-Depth Information
LISTING 7.20
continued
add (b1);
add (b2);
add (b3);
add (b4);
add (b5);
}
}
DISPLAY
(though in this case that is unnecessary, because JPanel defaults to flow layout).
The buttons are then created and added to the panel.
The size of each button is made large enough to accommodate the size of the
label that is put on it. As we mentioned earlier, flow layout puts as many of these
Search WWH ::




Custom Search