
12.14 Layout Managers: BorderLayout 905
In our ButtonHandler event handler (lines 51–69), the actionPerformed
method first determines the button that fired the event, translating the
source button to an integer value between 0 and 3. That value is assigned to
the local variable source. We want to allow only bids that are legal and only
from the player whose turn it is. If source is the bidder and bidding is
allowed (lines 65–66), we display a new bid (line 67); otherwise, we do not.
Figure 12.22 shows the Bridge bidding example running.
1 /** Using BorderLayout to display Bridge bidding
2 * Anderson, Franceschi
3 */
4
5 import javax.swing.*;
6 import