From: <b_...@us...> - 2003-07-26 01:45:20
|
Update of /cvsroot/ordweb/uop/pos407/team/week5 In directory sc8-pr-cvs1:/tmp/cvs-serv13242 Added Files: tw5.java Log Message: init --- NEW FILE: tw5.java --- /** * author: poulh, bmeier * created: Jul 10, 2003: 10:44:12 PM * purpose: Spin implementation * version history: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ordweb/uop/pos407/team/week3/tw3.java * notes: */ import javax.swing.*; //import javax.swing.event.*; import java.awt.*; import java.awt.event.*; public class tw5 extends JFrame implements ActionListener { /** module-level variables */ private JPanel pan = new JPanel(); //All content to be added to pan. private JPanel pnlDealer = new JPanel(); //Dealer's Card Panel private JPanel pnlCmd = new JPanel(); //Command Button Panel private JPanel pnlPlayer = new JPanel(); //Player's Card Panel private JLabel d1; //Dealer card 1 private JLabel d2; //Dealer card 2 private JLabel d3; //Dealer card 3 private JLabel d4; //Dealer card 4 private JLabel d5; //Dealer card 5 private JLabel p1; //Player card 1 private JLabel p2; //Player card 2 private JLabel p3; //Player card 3 private JLabel p4; //Player card 4 private JLabel p5; //Player card 5 public static JButton cmdHit = new JButton(); //Hit button public static JButton cmdStand = new JButton();//Stand button public static JLabel lblPlays = new JLabel();//Displays play attempts public static JLabel lblPayout = new JLabel();//Displays payout infoomration public static int plays = 0; //Number of plays private tw5 () { super("Video BlackJack..."); initFrame(); } public static void main(String[] args) { tw5 jFr = new tw5(); jFr.setSize(500, 500); jFr.setVisible(true); } /** purpose: Initialize the JFrame w/components. */ private void initFrame(){ setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); pan.setLayout(new FlowLayout()); //Set the Panel Layout to FlowLayout. d1 = new JLabel(new ImageIcon("/cards/b.gif")); d2 = new JLabel(new ImageIcon("/cards/b.gif")); pnlDealer.setLayout(new GridLayout(1, 5, 5, 5)); pnlDealer.setPreferredSize(new Dimension(300, 100)); pnlDealer.add(d1); pnlDealer.add(d2); p1 = new JLabel(new ImageIcon("/cards/b.gif")); p2 = new JLabel(new ImageIcon("/cards/b.gif")); pnlPlayer.setLayout(new GridLayout(1, 5, 5, 5)); pnlPlayer.setPreferredSize(new Dimension(300, 100)); pnlPlayer.add(p1); pnlPlayer.add(p2); lblPlays.setText(""); lblPayout.setText(""); pnlCmd.setLayout(new GridLayout(1, 4, 5, 5)); pnlCmd.setPreferredSize(new Dimension(300, 75)); pnlCmd.add(lblPlays); pnlCmd.add(cmdHit); pnlCmd.add(cmdStand); pnlCmd.add(lblPayout); //Add components to the JPanel. pan.add(pnlDealer); pan.add(pnlCmd); pan.add(pnlPlayer); setContentPane(pan); }// END initFrame /** purpose: Click handler */ public void actionPerformed(ActionEvent e) { if (e.getSource() == cmdHit) { } else if (e.getSource() == cmdStand) { } }// END actionPerformed /** purpose: set the slots blank */ private void reset(){ }//END reset }// END tw5 |