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
|
public class MainFrame extends JFrame{
public PanneauImage panneauBouton1;
public PanneauImage panneauBouton2;
public PanneauImage panneauBouton3;
public PanelInformation panelInfo;
public PanelGraphe panelGraphe;
public PanelDetailReleve panelDetailReleve;
public MainFrame(){
initComponents();
this.setVisible(true);
}
/**
* This method initializes this
*
* @return void
*/
private void initComponents() {
this.setTitle("Mon Titre");
Dimension tailleEcran = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
int screenHeight = (int)tailleEcran.getHeight() -50;
int screenWidth = (int)tailleEcran.getWidth();
int widthNav = 160;
int cellWidth = 10;
//this.setSize(largeurEcran, hauteurEcran);
//this.setResizable(false);
GraphicsEnvironment env =
GraphicsEnvironment.getLocalGraphicsEnvironment();
this.setMaximizedBounds(env.getMaximumWindowBounds());
this.setExtendedState(this.getExtendedState() | this.MAXIMIZED_BOTH);
this.setLocationRelativeTo(null);
this.setLayout(null);
// Panneau noir de gauche
JPanel panneauNavGauche = new JPanel();
panneauNavGauche.setLayout(null);
panneauBouton1 = new PanneauImage("bouton1.png", 10, 180, 150);
panneauNavGauche.add(panneauBouton1 );
panneauBouton2= new PanneauImage(Const.IMG_BTN_RELEVE, 10, 350, 150);
panneauNavGauche.add(panneauBouton2);
panneauBouton2 = new PanneauImage("btn2.png", 10, 520, 150);
panneauNavGauche.add(panneauBoutonAide);
// Ajout des boutons de bas de page
boutonQuitter = new JButton("Quitter"); //, 648, 10);
boutonQuitter.setBounds(40,(screenHeight - 50), 100,40);
//widthNav/2 - 40 ,screenHeight - 40, 80,20);
panneauNavGauche.add(boutonQuitter);
panneauNavGauche.setBackground(Color.DARK_GRAY);
panneauNavGauche.setBounds(0, 0,widthNav, screenHeight + 50); //+50correspon a la barre des taches
this.add(panneauNavGauche);
// Ajout Panel Info
panelInfo = new PanelInformation();
//panelInfo.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), ""));
panelInfo.setBounds(widthNav+cellWidth, 0,screenWidth-2*cellWidth,screenHeight);
panelInfo.setVisible(true);
this.add(panelInfo);
//Ajout Panel Releve
panelDetailReleve = new PanelDetailReleve();
//panelDetailReleve.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), ""));
panelDetailReleve.setBounds(widthNav+cellWidth, 0,screenWidth-2*cellWidth,screenHeight);
this.add(panelDetailReleve);
panelDetailReleve.setVisible(false);
} |
Partager