public class main extends Applet{
public static Image codah;
public static JPanel ecran;
public static JPanel menu;
public static JPanel icone;
public static JPanel menuAccueil;
public static JPanel boutons;
public static JPanel boutonsAccueil;
public static JPanel panneauSupervision;
public static JPanel ecranDroite;
public Label acceuil = new Label ("Acceuil WIZCON");
/**
* @param args
*/
public JPanel acceuil() {
ecran = new JPanel();
ecran.setLayout(new BorderLayout());
ecran.setPreferredSize(new Dimension(1024,768));
//----------------------------------------
// creation de la barre de menu
menu = new JPanel();
menu.setLayout(new BorderLayout());
menu.setPreferredSize(new Dimension(341,256));
//--------------------------------
// insertion de l'icone de la codah
icone = new JPanel();
icone.setLayout(new BorderLayout());
icone.setLayout(new FlowLayout(FlowLayout.CENTER));
icone.setPreferredSize(new Dimension(341,256));
ImageFond image = new ImageFond("CODAH.GIF");
icone.add(image.afficher());
// icone créée
// -------------------------------
// creation des boutons
boutons = new JPanel();
boutons.setLayout(new BorderLayout());
boutons.setPreferredSize(new Dimension(341,512));
//----------------------------
//creation des boutons d'accueil
boutonsAccueil = new JPanel();
boutonsAccueil.setLayout(new BorderLayout());
boutonsAccueil.setLayout(new FlowLayout(FlowLayout.CENTER));
boutonsAccueil.setPreferredSize(new Dimension(113,512));
barreAccueil barreAccueil = new barreAccueil();
boutonsAccueil.add(barreAccueil.activer(),BorderLayout.WEST);
//boutons d'accueil créés
//----------------------------
//creation du panneau accueillant la supervision
panneauSupervision = new JPanel();
panneauSupervision.setLayout(new BorderLayout());
panneauSupervision.setPreferredSize(new Dimension(227,512));
//panneau créé
//----------------------------
boutons.add(boutonsAccueil,BorderLayout.WEST);
boutons.add(panneauSupervision,BorderLayout.EAST);
// boutons créées
//--------------------------------
menu.add(icone,BorderLayout.NORTH);
menu.add(boutons,BorderLayout.SOUTH);
// barre de menu créée
//------------------------------------------
// creation du panneau secondaire
ecranDroite = new JPanel();
ecranDroite.setLayout(new BorderLayout());
ecranDroite.setPreferredSize(new Dimension(683,768));
// ecran de droite créé
//------------------------------------------
ecran.add(menu,BorderLayout.WEST);
ecran.add(ecranDroite,BorderLayout.EAST);
return ecran;
}
public void init (){
setBackground (Color.red);
add(acceuil());
}
}
Partager