1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
public void displayinit(){
.....
// initialisation de tous les centres
company.initDisplay(width - leftPanel.getPreferredSize().width, height);
this.cl = new CardLayout();
this.rightPanel = new JPanel(cl);
// ajout de tous les centres dans le Cardlayout
this.panelCenter = company.getAllJPanel();
for(Center c : panelCenter){
this.rightPanel.add(c.getName(),c);
}
// ajout du panel de droite dans mon applet
this.getContentPane().setLayout(new BorderLayout());
this.getContentPane().add(this.rightPanel, BorderLayout.CENTER);
} |
Partager