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.
Tosaveyousomework, Listing9-21 presentsthe Card classthateachof BJDeal-
er and BJPlayer uses.
Listing 9-21. Describing a playing card in terms of suit and rank
import java.io.Serializable;
Search WWH ::




Custom Search