1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
| package GUI;
import javax.swing.*;
/**
* <p>Titre : </p>
*
* <p>Description : </p>
*
* <p>Copyright : Copyright (c) 2006</p>
*
* <p>Société : </p>
*
* @author non attribuable
* @version 1.0
*/
/**
* <p>Titre : </p>
*
* <p>Description : </p>
*
* <p>Copyright : Copyright (c) 2006</p>
*
* <p>Société : </p>
*
* @author non attribuable
* @version 1.0
*/
import java.awt.BorderLayout;
import java.awt.event.MouseEvent;
import java.awt.event.MouseAdapter;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import java.awt.Color;
import java.awt.Dimension;
public class gui extends JFrame {
public static int b = 0;
public gui() {
try {
jbInit();
} catch (Exception ex) {
ex.printStackTrace();
}
// this.show();
}
public void main(String arg[] )
{
//modification GUI
gui gui =new gui();
}
public void jbInit() throws Exception {
jPanel1.setLayout(xYLayout1);
jLabel1.setIcon(new ImageIcon(new java.net.URL("file:///C:/jasblackjack/titre.gif")));
jPanel1.setBackground(Color.white);
jPanel1.setMinimumSize(new Dimension(640, 480));
jToggleButton1.addMouseListener(new
uneinterf_jToggleButton1_mouseAdapter(this));
jLabel2.setIcon(new ImageIcon(new java.net.URL("file:///C:/jasblackjack/tapis.jpg")));
carte1.setIcon(new ImageIcon(new java.net.URL("cartes/coeur/simple_d_2.png")));
jButton1.setText("Stand");
this.setTitle("SJA BlackJack");
this.setBounds(0,0,640,510);
jLabel4.setText("Votre mise :");
jLabel5.setText("Votre avoir :");
editAvoir.setText("jTextField1");
jButton2.setText("Valider");
jLabel3.setText("jLabel3");
jPanel1.add(jLabel1, new XYConstraints(2, 1, -1, -1));
jPanel1.add(jLabel2, new XYConstraints(17, 101, -1, -1));
jPanel1.add(carte1, new XYConstraints(17, 151, -1, -1));
jPanel1.add(jToggleButton1, new XYConstraints(93, 425, -1, -1));
jPanel1.add(jButton1, new XYConstraints(217, 425, -1, -1));
jPanel1.add(jLabel4, new XYConstraints(408, 114, -1, -1));
jPanel1.add(jLabel5, new XYConstraints(408, 169, -1, -1));
jPanel1.add(jSpinner1, new XYConstraints(407, 130, 75, -1));
jPanel1.add(editAvoir, new XYConstraints(407, 191, 75, -1));
jPanel1.add(jButton2, new XYConstraints(407, 368, -1, -1));
jPanel1.add(jLabel3, new XYConstraints(386, 253, -1, -1));
this.getContentPane().add(jPanel1, java.awt.BorderLayout.EAST);
jToggleButton1.setText("Hit");
}
JPanel jPanel1 = new JPanel();
JToggleButton jToggleButton1 = new JToggleButton();
XYLayout xYLayout1 = new XYLayout();
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JLabel carte1 = new JLabel();
JButton jButton1 = new JButton();
JSpinner jSpinner1 = new JSpinner();
JLabel jLabel4 = new JLabel();
JLabel jLabel5 = new JLabel();
JTextField editAvoir = new JTextField();
JButton jButton2 = new JButton();
JLabel jLabel3 = new JLabel();
public void jToggleButton1_mouseClicked(MouseEvent e) {
this.b = 1;
System.out.println("bouton hit appuyé");
}
//fonctions de controles
public void DefinirAvoir(String Newavoir)
{
this.editAvoir.setText(Newavoir);
}
public int getmise()
{
String stmise ;
stmise = (String) this.jSpinner1.getValue();
int mise = Integer.parseInt(stmise);
return mise;
}
}
class uneinterf_jToggleButton1_mouseAdapter extends MouseAdapter {
private gui adaptee;
uneinterf_jToggleButton1_mouseAdapter(gui adaptee) {
this.adaptee = adaptee;
}
public void mouseClicked(MouseEvent e) {
adaptee.jToggleButton1_mouseClicked(e);
}
} |