Voila la class phasedejeu en entier:
package fourmiliere;
import javax.swing.JFrame;
import javax.swing.*;
import java.awt.*;
import javax.swing.border.TitledBorder;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class phasedejeu extends JFrame{
public phasedejeu() {
//Icon tigerIcon = new ImageIcon("Creative player 128.gif");
try {
jbInit();
} catch (Exception ex) {
ex.printStackTrace();
}
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setLocation(100,100);
this.setSize(700,550);
this.setTitle("Simulation");
this.setVisible(true);
}
private void jbInit() throws Exception {
jLabel1.setForeground(Color.white);
jLabel1.setText("jLabel1");
jTextField3.setText("jTextField3");
jTextField4.setText("jTextField4");
jLabel3.setForeground(Color.white);
jLabel3.setText("jLabel3");
jLabel4.setForeground(Color.white);
jLabel4.setText("jLabel4");
jTextField5.setText("jTextField5");
jTextField6.setText("jTextField6");
jLabel5.setForeground(Color.white);
jLabel5.setText("jLabel5");
jLabel6.setForeground(Color.white);
jLabel6.setText("jLabel6");
jLabel7.setForeground(Color.white);
jLabel7.setText("jLabel7");
jLabel8.setForeground(Color.white);
jLabel8.setText("jLabel8");
jLabel9.setForeground(Color.white);
jLabel9.setText("jLabel9");
jLabel10.setForeground(Color.white);
jLabel10.setText("jLabel10");
jPanel3.setLayout(flowLayout2);
jPanel4.setLayout(gridLayout2);
gridLayout2.setColumns(4);
gridLayout2.setRows(2);
jLabel11.setForeground(Color.white);
jLabel11.setToolTipText("");
jLabel11.setHorizontalAlignment(SwingConstants.CENTER);
jLabel11.setHorizontalTextPosition(SwingConstants.CENTER);
jLabel11.setText(" Vitesse de la Simulation");
jPanel1.setBackground(SystemColor.desktop);
jPanel1.setPreferredSize(new Dimension(100, 500));
jPanel1.setToolTipText("");
jPanel1.setLayout(flowLayout1);
gridLayout1.setHgap(5);
gridLayout1.setVgap(10);
flowLayout1.setVgap(20);
this.setResizable(true);
jButton2.setMaximumSize(new Dimension(33, 33));
jButton2.setMinimumSize(new Dimension(33, 33));
jButton2.setPreferredSize(new Dimension(33, 33));
jButton2.setHorizontalTextPosition(SwingConstants.CENTER);
jButton1.setMaximumSize(new Dimension(33, 33));
jButton1.setMinimumSize(new Dimension(33, 33));
jButton1.setPreferredSize(new Dimension(33, 33));
jButton1.setHorizontalTextPosition(SwingConstants.CENTER);
jPanel3.setBackground(SystemColor.desktop);
jPanel6.setBackground(SystemColor.desktop);
jPanel7.setBackground(SystemColor.desktop);
jPanel2.setBackground(SystemColor.desktop);
jLabel2.setForeground(Color.white);
jPanel4.setBackground(SystemColor.desktop);
jSlider1.setBackground(SystemColor.desktop);
jSlider1.setForeground(Color.white);
this.getContentPane().add(jPanel1, java.awt.BorderLayout.WEST);
jPanel1.add(jPanel2, null);
jPanel2.setLayout(gridLayout1);
gridLayout1.setColumns(1);
gridLayout1.setRows(15);
jLabel2.setText("jLabel2");
jPanel2.add(jLabel2);
jPanel2.add(jLabel10);
jPanel2.add(jTextField6);
jPanel2.add(jLabel9);
jPanel2.add(jLabel8);
jPanel2.add(jTextField5);
jPanel2.add(jLabel7);
jPanel2.add(jLabel6);
jPanel2.add(jTextField4);
jPanel2.add(jLabel5);
jPanel2.add(jLabel4);
jPanel2.add(jTextField3);
jPanel2.add(jLabel3);
jPanel2.add(jLabel1);
jPanel3.add(jPanel4);
jPanel4.add(jLabel11);
jPanel4.add(jButton2);
jPanel4.add(jSlider1);
jPanel4.add(jButton1);
this.getContentPane().add(jPanel5, java.awt.BorderLayout.CENTER);
this.getContentPane().add(jPanel3, java.awt.BorderLayout.SOUTH);
this.getContentPane().add(jPanel6, java.awt.BorderLayout.EAST);
this.getContentPane().add(jPanel7, java.awt.BorderLayout.NORTH);
}
JPanel jPanel1 = new JPanel();
JPanel jPanel2 = new JPanel();
GridLayout gridLayout1 = new GridLayout();
JLabel jLabel2 = new JLabel();
JLabel jLabel1 = new JLabel();
JTextField jTextField3 = new JTextField();
JTextField jTextField4 = new JTextField();
JLabel jLabel3 = new JLabel();
JLabel jLabel4 = new JLabel();
JTextField jTextField5 = new JTextField();
JTextField jTextField6 = new JTextField();
JLabel jLabel5 = new JLabel();
JLabel jLabel6 = new JLabel();
JLabel jLabel7 = new JLabel();
JLabel jLabel8 = new JLabel();
JLabel jLabel9 = new JLabel();
JLabel jLabel10 = new JLabel();
JPanel jPanel3 = new JPanel();
FlowLayout flowLayout2 = new FlowLayout();
JPanel jPanel4 = new JPanel();
GridLayout gridLayout2 = new GridLayout();
JSlider jSlider1 = new JSlider();
JLabel jLabel11 = new JLabel();
FlowLayout flowLayout1 = new FlowLayout();
private JPanelDessin2 jPanel5 = new JPanelDessin2(this);
private Dimension dim = jPanel5.getSize() ;
private int larg = dim.width ;
private int haut = dim.height;
public int getLarg(){
return larg;
}
public void setLarg(int x){
larg=x;
}
public int getHaut(){
return haut;
}
public void setHaut(int y){
haut=y;
}
JPanel jPanel6 = new JPanel();
JPanel jPanel7 = new JPanel();
TitledBorder titledBorder1 = new TitledBorder("");
Icon tigerIcon = new ImageIcon("stop.gif");
JButton jButton1 = new JButton("",tigerIcon);
Icon stopIcon = new ImageIcon("lecture2.gif");
JButton jButton2 = new JButton("",stopIcon);
Icon fourmIcon = new ImageIcon("fourmis.gif");
}
classe principale:
package fourmiliere;
/**
* <p>Titre : </p>
*
* <p>Description : </p>
*
* <p>Copyright : Copyright (c) 2007</p>
*
* <p>Société : </p>
*
* @author non attribuable
* @version 1.0
*/
public class principale {
public principale() {
try {
jbInit();
} catch (Exception ex) {
ex.printStackTrace();
}
}
public static void main(String[] args) {
Bienvenue monBienvenue = new Bienvenue();
phasedejeu maphasedejeu=new phasedejeu();
Bilan monBilan=new Bilan();
Erreur monErreur=new Erreur();
}
private void jbInit() throws Exception {
}
}
Voila la class phasedejeu en entier:
classe principale: