IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

 Java Discussion :

[débutant]Interface graphique Récalcitrante


Sujet :

Java

  1. #1
    Membre régulier
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    109
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 109
    Points : 71
    Points
    71
    Par défaut [débutant]Interface graphique Récalcitrante
    Bonsoir,
    je suis en train de faire une petite IHM comportant 2 onglets comportant chacun des menus déroulants tout compile correctement mais lorsque j'execute j'ai une toute petite fenetre en haut a droite de mon ecran on est obligé d'agrandir pour voir la fenetre et lorsque la fenetre s'agrandit qu'est ce qu'on voit? ben rien du tout un ecran blanc
    Si vous pouvez m'aidez je vous remercie
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    141
    142
    143
    144
    public class IhmAdmin extends Frame  implements ActionListener{
     
       /**Liste des menus déroulant pour les diplômes departements promotions années ect...**/
     
          protected JComboBox cadd;
          protected JComboBox cuser;
          protected JComboBox csup;
          protected JComboBox cdept;
          protected JComboBox cdipl;
          protected JComboBox cpromo;
          protected JComboBox cyear;
          protected JComboBox cmat;
          protected JComboBox cetu;
          protected JLabel login;
          protected JLabel mdp;
          protected JLabel nature;
          protected JLabel fonction;
          protected JButton bmodif;
          protected JButton bsup;
          protected JButton bsecr;
          protected JButton bens;
          protected JTabbedPane onglet;
          protected JPanel p1_note;
          protected JPanel p2_note;
          protected JPanel p3_note;
          protected JPanel p1_user;
          protected JPanel p2_user; 
          protected JPanel jpnote;
          protected JPanel jpuser;
          protected JTextArea tlogin;
          protected JTextArea tmdp;
          protected JTextArea tnature;
          protected JTextArea tfonction;
     
     
       /** <p> Constructeur de la classe IhmAdmin: </p>
       *     <p> Placement des boutons des menus déroulant </p>
       *     <p> Création des onglets </p> 
       **/
     
           public IhmAdmin(){
             super ("Configuration Administrateur");
     
          //etape 1: initialisation du composant
     
          /*Composant du 1er panel de l'onglet*/
     
             bsup=new JButton(" Supprimer  ");
             bsecr= new JButton(" Secretaire ");
             bens= new JButton(" Enseignant ");
             cetu=new JComboBox();
             cmat=new JComboBox();
             cadd=new JComboBox();
             csup=new JComboBox();
             cyear=new JComboBox();
             cdept=new JComboBox();
             cdipl=new JComboBox();
             cpromo=new JComboBox();
             onglet=new JTabbedPane();
             p1_note=new JPanel();
             p2_note=new JPanel();
             p3_note=new JPanel();
             jpnote = new JPanel();
             jpuser = new JPanel();
     
             /*onglet utilisateur*/
     
             login=new JLabel();
             mdp=new JLabel();
             nature=new JLabel();
             fonction=new JLabel();
             bmodif=new JButton();
             cuser=new JComboBox();
             tlogin=new JTextArea();
             tmdp=new JTextArea();
             tnature=new JTextArea();
             tfonction=new JTextArea();
             p1_user=new JPanel();
             p2_user=new JPanel();
     
          	//etape 2 placement des composants
     
          	/*placement dans l'onglet Note*/
     
             p1_note.add(cdept);
             p1_note.add(cdept);
             p1_note.add(cdipl);
             p1_note.add(cpromo);
             p1_note.add(cyear);
             p1_note.add(cmat);
             p2_note.add(cetu);
             p2_note.add(cadd);
             p2_note.add(csup);
             p3_note.add(bsecr);
             p3_note.add(bens);
             jpnote.add(p1_note);
             jpnote.add(p2_note);
             jpnote.add(p3_note);
             onglet.add("Note",jpnote);
             onglet.add("Utilisateur",jpuser);
     
           /*placement des composants dans l'onglet user*/ 
     
             p1_user.add(cuser);
             p1_user.add(bmodif);
             p2_user.add(login);
             p2_user.add(mdp);
             p2_user.add(nature);
             p2_user.add(fonction);
             p2_user.add(tlogin);
             p2_user.add(tmdp);
             p2_user.add(tnature);
             p2_user.add(tfonction);
             jpuser.add(p1_user);
             jpuser.add(p2_user);
             onglet.add("Note",jpnote);
             onglet.add("Utilisateur",jpuser);
     
     
     
     
             //etape 3 abonnements
          	//ajout des actions listener A COMPLETER
             this.addWindowListener(new FermeFenetre());
     
          	//visualisation
             this.setSize(600,800);
             this.pack();
             this.show();
     
          }
           public void actionPerformed(ActionEvent e){}
     
           public static void main (String args[]){
             new IhmAdmin();
          }
     
           class FermeFenetre extends WindowAdapter {//WindowsAdapter implemente WindowListener
              public void windowClosing(WindowEvent e){
                System.exit(0);
     
             }
          }
       }
    De même si vous avez des critiques(conventions que je ne respecte pas methode mal ecrite )n'hésitez pas.
    Merci beaucoup

  2. #2
    Membre régulier
    Profil pro
    Inscrit en
    Juillet 2003
    Messages
    85
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France, Nord (Nord Pas de Calais)

    Informations forums :
    Inscription : Juillet 2003
    Messages : 85
    Points : 73
    Points
    73
    Par défaut
    Apres un rapide coup d'oeil je remarque que tu creer un ensemble 'objet. Tu les relies entre eux et tout et tout. C'est bien. Mais, peut etre je me trompe, tu les relies pas a ta fenetre principale...

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    this.add(monPanelPrincipal);
    serai peut etre bienvenue je crois

  3. #3
    Membre régulier
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    109
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 109
    Points : 71
    Points
    71
    Par défaut
    Merci bcp ca marche j'ai plu qu'a bien organisé le tout dans ma Frame

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Débutant Interface graphique
    Par kiooik dans le forum Débuter
    Réponses: 6
    Dernier message: 17/09/2008, 19h21
  2. [Débutant] Interface graphique avec un périphérique USB
    Par mr:titi7 dans le forum Langages de programmation
    Réponses: 8
    Dernier message: 02/11/2007, 17h54
  3. [Débutant]Interface graphique avec eclipse
    Par steelidol dans le forum Eclipse Platform
    Réponses: 5
    Dernier message: 08/06/2006, 13h12
  4. Création d'interface graphique pour débutant ...
    Par lesuisse dans le forum AWT/Swing
    Réponses: 3
    Dernier message: 08/03/2006, 13h20
  5. [Débutant] Interface Graphique
    Par Ben.fr dans le forum Eclipse Java
    Réponses: 7
    Dernier message: 23/06/2005, 18h27

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo