资源描述:
《四人斗地主java程序》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、packagepoker;/***
Title:斗地主
*
Description:
*
Copyright:Copyright(c)2004
*
Company:
*@author李艳生*@version1.0*/importjava.awt.*;importjavax.swing.*;importjava.awt.event.*;importjava.util.*;publicclassCallPokerDialogextendsJDialog{JButtonbtnOne=
2、newJButton();JButtonbtnTwo=newJButton();JButtonbtnThree=newJButton();JButtonbtnFour=newJButton();intscore=PokerKernal.score;publicCallPokerDialog(){try{jbInit();}catch(Exceptione){e.printStackTrace();}}privatevoidjbInit()throwsException{this.setSize(newDimensio
3、n(330,80));//居中显示DimensionscreenSize=Toolkit.getDefaultToolkit().getScreenSize();this.setLocation((screenSize.width-330)/2,(screenSize.height-80)/2);this.setModal(true);this.setResizable(false);this.setTitle("请叫牌");if(score==1){btnOne.setBackground(Color.pink);
4、}elseif(score==2){btnOne.setBackground(Color.pink);btnTwo.setBackground(Color.pink);}btnOne.setBounds(newRectangle(11,16,67,25));btnOne.setText("1分");btnOne.addActionListener(newCallPokerDialog_btnOne_actionAdapter(this));this.getContentPane().setLayout(null);b
5、tnTwo.setBounds(newRectangle(82,17,73,25));btnTwo.setText("2分");btnTwo.addActionListener(newCallPokerDialog_btnTwo_actionAdapter(this));btnThree.setBounds(newRectangle(161,17,73,25));btnThree.setText("3分");btnThree.addActionListener(newCallPokerDialog_btnThree_
6、actionAdapter(this));btnFour.setBounds(newRectangle(240,16,73,25));btnFour.setSelected(false);btnFour.setText("不要");btnFour.addActionListener(newCallPokerDialog_btnFour_actionAdapter(this));this.getContentPane().add(btnOne,null);this.getContentPane().add(btnTwo
7、,null);this.getContentPane().add(btnThree,null);this.getContentPane().add(btnFour,null);}voidbtnOne_actionPerformed(ActionEvente){if(score<1){PokerKernal.score=1;PokerKernal.two.call=1;this.dispose();}}voidbtnTwo_actionPerformed(ActionEvente){if(score<2){PokerK
8、ernal.two.call=2;PokerKernal.score=2;this.dispose();}}voidbtnThree_actionPerformed(ActionEvente){if(score<3){PokerKernal.two.call=3;PokerKernal.score=3;this.dispose();}}void