Java Reference
In-Depth Information
Figure 9-6.
BJPlayer
's GUI consists of a component to render playing cards (player's cards
in top half and dealer's cards in bottom half) and a panel to display status messages and but-
tons.
TheplayerclickstheDealbuttontohavetheDealerdealanewhand.Thisbuttonis
subsequentlydisableduntiltheplayerlosesorwins.TheplayerclickstheHitbutton
torequestanothercardfromthedealer,andclickstheStandbuttonwhenthedealeris
standing—thesebuttonsaredisabledwhenDealisenabled.Finally,theplayerclicks
the Exit button to terminate the game.
er
and
BJPlayer
uses.
Listing 9-21.
Describing a playing card in terms of suit and rank
import java.io.Serializable;