Help pour mon projet fin d'etude

Signaler
Messages postés
46
Date d'inscription
mercredi 26 mars 2008
Statut
Membre
Dernière intervention
28 mai 2008
-
Messages postés
95
Date d'inscription
dimanche 29 juillet 2007
Statut
Membre
Dernière intervention
27 août 2011
-
j'ai essayé ce code mais il apparait un autre prob c que j'ai pas pu ajouter les bouton:
**********************************************************

package telecom;






/**
 * Title:

 * Description:

 * Copyright: Copyright (c) 2008

 * Company:

 * @author not attributable
 * @version 1.0
 */
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.border.*;
import com.borland.jbcl.layout.*;
//************************************************ErlangC*******************************
class ErlangC extends JFrame{
 public ErlangC (){
        this.setBounds(600, 600, 600, 600);
        this.setVisible(true);



  }
}







//************************************************ErlangB********************************
class ErlangB extends JFrame{
 public ErlangB (){
         this.setBounds(600, 600, 600, 600);
         this.setVisible(true);



   }
}






//********************************ErlangA************************************
class ErlangA extends JFrame{



  public ErlangA (){
         this.setBounds(600, 600, 600, 600);
         this.setVisible(true);



   }
}
 //*****************************Index*****************************************
 public class Index extends JFrame{
   private JMenuBar menu_bar = new JMenuBar();
   private JMenu menu1 = new JMenu("Téléphonie Analogique");
   private JMenuItem menu_item11 = new JMenuItem("ErlangA");
   private JMenuItem menu_item21 = new JMenuItem("ErlangB");
   private JMenuItem menu_item31 = new JMenuItem("ErlangC");
   private JMenu menu2 = new JMenu("Téléphonie sur IP");
   private JMenuItem menu_item12 = new JMenuItem("ol1");
   private JMenuItem menu_item22 = new JMenuItem("ol2");
   private JMenuItem menu_item32 = new JMenuItem("ol3");
   private JMenu menu3 = new JMenu("Centre d'Appel");
   private JMenu menu4 = new JMenu("Téléphonie Cellulaire");
   private JMenu menu5 = new JMenu("Aide");
  XYLayout xYLayout1 = new XYLayout();
   public Index(){
       menu_bar.add(menu1);
       menu1.add(menu_item11);
       menu1.add(menu_item21);
       menu1.add(menu_item31);
       menu_bar.add(menu2);
       menu2.add(menu_item12);
       menu2.add(menu_item22);
       menu2.add(menu_item32);
       menu_bar.add(menu3);
       menu_bar.add(menu4);
       menu_bar.add(menu5);




 



       // Ajout de l'écouteur sur la commande Quitter du menu Fichier
       menu_item11.addActionListener(new ActionListener(){
           public void actionPerformed(ActionEvent e){
               ErlangA EA = new ErlangA();
           }
       });
       menu_item21.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent e){
              ErlangB EB = new ErlangB();
          }
      });
      menu_item31.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e){
            ErlangC EC = new ErlangC();
        }
    });
    menu_item12.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent e){
              ErlangA E1 = new ErlangA();
          }
      });
      menu_item22.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent e){
              ErlangA E2 = new ErlangA();
          }
      });
      menu_item32.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent e){
              ErlangA E3 = new ErlangA();
          }
      });
       Container conteneur = this.getContentPane();
       JPanel pan = new JPanel();
       pan.add(menu_bar);



       conteneur.add(pan, BorderLayout.NORTH);



       this.setSize(600, 600);
       this.setVisible(true);
       this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);





   }
//************************main**********************************
   public static void main(String[] args){
       Index f = new Index();



}
 }




 


*************************************************
puisque j'ai déja fait mes interface en jbuilder9  j'aime savoir comment se deplacer entre eux:
pour cela j'ai mis ci-dessou les code de deux interfaces


:




**************************************interface1:Index**************************************

package trafic1;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;

public class Index extends JFrame {
  JPanel contentPane;
  JMenuBar jMenuBar1 = new JMenuBar();
  JMenu jMenuAnalogique = new JMenu();
  JMenuItem jMenuEA = new JMenuItem();
  JMenu jMenuIP = new JMenu();
  XYLayout xYLayout1 = new XYLayout();
  JMenuItem jMenuEB = new JMenuItem();
  JMenuItem jMenuEC = new JMenuItem();
  JMenuItem jMenuExit = new JMenuItem();
  JMenu jMenuCentrAppel = new JMenu();
  JMenu jMenuCellulaire = new JMenu();
  JMenu jMenuAide = new JMenu();
  JLabel jLabel1 = new JLabel();
  JLabel jLabel2 = new JLabel();



  //Construct the frame
  public Index() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
      jbInit();
    }
    catch(Exception e) {
      e.printStackTrace();
    }
  }
  //Component initialization
  private void jbInit() throws Exception  {
    contentPane = (JPanel) this.getContentPane();
    contentPane.setLayout(xYLayout1);
    this.setSize(new Dimension(500, 300));
    this.setTitle("Index");
    jMenuAnalogique.setText("Téléphonie Analogique");
    jMenuEA.setText("Erlang A");
    jMenuEA.addFocusListener(new Index_jMenuEA_focusAdapter(this));
    jMenuEA.addActionListener(new Index_jMenuEA_ActionAdapter(this));
    jMenuIP.setText("Téléphonie sur IP");
    jMenuEB.setBackground(Color.white);
    jMenuEB.setText("Erlang B");
    jMenuEC.setText("Erlang C");
    jMenuExit.setText("Exit");
    jMenuCentrAppel.setText("Centre d\'Appel");
    jMenuCellulaire.setText("Téléphonie Cellulaire");
    jMenuAide.setText("Aide");
    jLabel1.setFont(new java.awt.Font("Dialog", 0, 20));
    jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
    jLabel1.setText("Bienvenue dans notre application:");
    jLabel2.setFont(new java.awt.Font("Serif", 1, 30));
    jLabel2.setForeground(Color.red);
    jLabel2.setHorizontalAlignment(SwingConstants.CENTER);
    jLabel2.setText("Dimonsionnement du Trafic Télécom");
    jMenuAnalogique.add(jMenuEA);
    jMenuAnalogique.add(jMenuEB);
    jMenuAnalogique.add(jMenuEC);
    jMenuAnalogique.add(jMenuExit);
    jMenuBar1.add(jMenuAnalogique);
    jMenuBar1.add(jMenuIP);
    jMenuBar1.add(jMenuCentrAppel);
    jMenuBar1.add(jMenuCellulaire);
    jMenuBar1.add(jMenuAide);
    contentPane.add(jLabel1,  new XYConstraints(55, 111, 397, 36));
    contentPane.add(jLabel2,  new XYConstraints(5, 162, 489, 117));
    this.setJMenuBar(jMenuBar1);
  }
  //File | Exit action performed
  public void jMenuEA_actionPerformed(ActionEvent e) {
    Object source=e.getSource();



     javax.swing.JPanel ErlangA = new javax.swing.JPanel();
       ErlangA.setVisible( true );
    }
  //Help | About action performed
  //Overridden so we can exit when window is closed
  protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
      jMenuEA_actionPerformed(null);
    }
  }





}



class Index_jMenuEA_ActionAdapter implements ActionListener {
  Index adaptee;



  Index_jMenuEA_ActionAdapter(Index adaptee) {
    this.adaptee = adaptee;
  }
  public void actionPerformed(ActionEvent e) {
    adaptee.jMenuEA_actionPerformed(e);
  }
}



class Index_jMenuEA_focusAdapter extends java.awt.event.FocusAdapter {
  Index adaptee;



  Index_jMenuEA_focusAdapter(Index adaptee) {
    this.adaptee = adaptee;
  }



}
************************************Interface2:Erlang***************************************

package trafic1;



import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
import javax.swing.border.*;



public class EA extends JFrame {
  JPanel ErlangA;
  XYLayout xYLayout2 = new XYLayout();
  JLabel jLabel1 = new JLabel();
  JLabel jLabel2 = new JLabel();
  JTextField nbrappel = new JTextField();
  JButton Calculer = new JButton();
  JLabel jLabel5 = new JLabel();
  JLabel jLabel6 = new JLabel();
  JTextField dureappel = new JTextField();
  JTextField EA = new JTextField();
  JRadioButton indefinie1 = new JRadioButton();
  JRadioButton indefinie2 = new JRadioButton();
  JRadioButton indefinie3 = new JRadioButton();
  TitledBorder titledBorder1;
  TitledBorder titledBorder2;
  JButton Quitter = new JButton();



  //Construct the frame
  public EA() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
      jbInit();
    }
    catch(Exception e) {
      e.printStackTrace();
    }
  }
  //Component initialization
  private void jbInit() throws Exception  {
    ErlangA = (JPanel) this.getContentPane();
    titledBorder1 = new TitledBorder("");
    titledBorder2 = new TitledBorder("");
    ErlangA.setLayout(xYLayout2);
    this.setSize(new Dimension(500, 500));
    this.setTitle("ErlangA");
    jLabel1.setFont(new java.awt.Font("Dialog", 1, 30));
    jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
    jLabel1.setText("Erlang A");
    jLabel2.setFont(new java.awt.Font("Dialog", 1, 12));
    jLabel2.setBorder(BorderFactory.createRaisedBevelBorder());
    jLabel2.setHorizontalAlignment(SwingConstants.CENTER);
    jLabel2.setText("Nombre d\'appel");
    nbrappel.setText("");
    Calculer.setFont(new java.awt.Font("Dialog", 1, 12));
    Calculer.setText("Calculer");
    Calculer.addActionListener(new EA_Calculer_actionAdapter(this));





 



    jLabel5.setText("Durée d\'appel");
    jLabel5.setHorizontalAlignment(SwingConstants.CENTER);
    jLabel5.setBorder(BorderFactory.createRaisedBevelBorder());
    jLabel5.setFont(new java.awt.Font("Dialog", 1, 12));
    jLabel6.setText("Erlang A");
    jLabel6.setHorizontalAlignment(SwingConstants.CENTER);
    jLabel6.setBorder(BorderFactory.createRaisedBevelBorder());
    jLabel6.setFont(new java.awt.Font("Dialog", 1, 12));
    dureappel.setText("");
    EA.setText("");
    indefinie1.setFont(new java.awt.Font("Dialog", 1, 12));
    indefinie1.setBorder(null);
    indefinie1.setActionCommand("jRadioButton1");
    indefinie1.setText("Indefinie");
    indefinie2.setFont(new java.awt.Font("Dialog", 1, 12));
    indefinie2.setBorder(null);
    indefinie2.setText("Indefinie");
    indefinie3.setFont(new java.awt.Font("Dialog", 1, 12));
    indefinie3.setBorder(null);
    indefinie3.setText("Indefinie");



    Quitter.addActionListener(new EA_Quitter_actionAdapter(this));



    Quitter.setText("Quitter");
    Quitter.addActionListener(new EA_Quitter_actionAdapter(this));
    Quitter.setFont(new java.awt.Font("Dialog", 1, 12));
    ErlangA.add(jLabel2, new XYConstraints(18, 162, 157, 26));
    ErlangA.add(jLabel5, new XYConstraints(19, 200, 157, 26));
    ErlangA.add(jLabel6, new XYConstraints(19, 242, 157, 26));
    ErlangA.add(nbrappel, new XYConstraints(202, 163, 145, 26));
    ErlangA.add(dureappel,    new XYConstraints(201, 200, 145, 26));
    ErlangA.add(EA,    new XYConstraints(201, 243, 145, 26));
    ErlangA.add(indefinie1,  new XYConstraints(370, 163, 121, 26));
    ErlangA.add(indefinie2, new XYConstraints(371, 199, 121, 26));
    ErlangA.add(indefinie3, new XYConstraints(371, 241, 121, 26));
    ErlangA.add(jLabel1,  new XYConstraints(131, 67, 251, 36));
    ErlangA.add(Calculer,   new XYConstraints(240, 435, 97, 27));
    ErlangA.add(Quitter,    new XYConstraints(351, 435, 97, 27));
  }
  //File | Exit action performed
  public void jMenuEA_actionPerformed(ActionEvent e) {
    System.exit(0);
  }
  //Help | About action performed
  //Overridden so we can exit when window is closed
  protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
      jMenuEA_actionPerformed(null);
    }
  }





  void Calculer_actionPerformed(ActionEvent e) {
    nbrappel.setText("Hello World!");
    dureappel.setText("Hello World!");
     EA.setText("Hello World!");



  }



  void Calculer_focusGained(FocusEvent e) {



  }



  void Calculer_mouseClicked(MouseEvent e) {



}



class EA_jMenuEA_ActionAdapter implements ActionListener {
  EA adaptee;



  EA_jMenuEA_ActionAdapter(EA adaptee) {
    this.adaptee = adaptee;
  }
  public void actionPerformed(ActionEvent e) {
    adaptee.jMenuEA_actionPerformed(e);
  }
}



class EA_jButton1_mouseAdapter extends java.awt.event.MouseAdapter {
  EA adaptee;



 void EA_Calculer_mouseAdapter(EA adaptee) {
    this.adaptee = adaptee;
  }
  public void mouseClicked(MouseEvent e) {
    adaptee.Calculer_mouseClicked(e);
  }
}



class EA_jButton1_actionAdapter implements java.awt.event.ActionListener {
  EA adaptee;



  void EA_Calculer_actionAdapter(EA adaptee) {
    this.adaptee = adaptee;
  }
  public void actionPerformed(ActionEvent e) {
    adaptee.Calculer_actionPerformed(e);
  }
}



class EA_jButton1_focusAdapter extends java.awt.event.FocusAdapter {
  EA adaptee;



  void EA_Calculer_focusAdapter(EA adaptee) {
    this.adaptee = adaptee;
  }
  public void focusGained(FocusEvent e) {
    adaptee.Calculer_focusGained(e);
  }
}



  void Quitter_actionPerformed(ActionEvent e) {
    System.exit(0);



  }}



class EA_Quitter_actionAdapter implements java.awt.event.ActionListener {
  EA adaptee;



  EA_Quitter_actionAdapter(EA adaptee) {
    this.adaptee = adaptee;
  }
  public void actionPerformed(ActionEvent e) {
    adaptee.Quitter_actionPerformed(e);
  }
}



class EA_Calculer_actionAdapter implements java.awt.event.ActionListener {
  EA adaptee;



  EA_Calculer_actionAdapter(EA adaptee) {
    this.adaptee = adaptee;
  }
  public void actionPerformed(ActionEvent e) {
    adaptee.Calculer_actionPerformed(e);
  }
}

je vous attends plz répond moi dans les plus proches délais
je me souffert vraiment de ce probleme
mon projet necessite plus que ca et j'ai pas du temp a perdre merci

3 réponses


Bonsoir

Excuse moi mais j'en ai marre que vous soyez tous pressés. Tout le monde a besoin d'aide, pourquoi toi plus que les autres? Ca ne donne vraiment pas envie de te venir en aide.

TUER : http://tuer.tuxfamily.org/tuer.php

yeah! vive java
Messages postés
764
Date d'inscription
jeudi 27 juillet 2006
Statut
Membre
Dernière intervention
6 septembre 2010
18
Salut,



on ne peut pas t'aider comme ça !

expose ton problème plus clairement car


j'ai essayé ce code mais il apparait un autre prob c que j'ai pas pu ajouter les bouton:



ne nous dit rien !
Messages postés
95
Date d'inscription
dimanche 29 juillet 2007
Statut
Membre
Dernière intervention
27 août 2011
1
explique stp!! j'ai rien compris là!!