scrollable JPAnel et smooth transition

This commit is contained in:
martins 2022-11-13 13:48:39 +01:00
parent 5116d7a998
commit 0eabe2b4bb

View File

@ -47,10 +47,10 @@ public class Model{
this.fenetre.setSize(1200, 720); this.fenetre.setSize(1200, 720);
this.fenetre.setLocation(100,100); this.fenetre.setLocation(100,100);
this.fenetre.addWindowListener(new ObservateurFenetre()); this.fenetre.addWindowListener(new ObservateurFenetre());
this.fenetre.setLayout(new GridLayout(1,2)); this.fenetre.setLayout(new GridLayout(2,1));
this.fenetre.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); this.fenetre.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
this.fenetre.add(this.fenGr); this.fenetre.add(new JScrollPane(this.fenGr));
this.fenetre.add(this.fenEtu); this.fenetre.add(new JScrollPane(this.fenEtu));
this.fenetre.setVisible(true); this.fenetre.setVisible(true);
} }
@ -162,18 +162,11 @@ public class Model{
} }
public void showGroupe(Groupe g){ public void showGroupe(Groupe g){
this.fenetre.dispose();
this.fenGr=new FenetreGroupe(g, this); this.fenGr=new FenetreGroupe(g, this);
this.fenEtu=new FenetreEtudiant(g); this.fenEtu=new FenetreEtudiant(g);
this.fenetre.getContentPane().removeAll();
this.fenetre=new JFrame(); this.fenetre.add(new JScrollPane(this.fenGr));
this.fenetre.setSize(1200, 720); this.fenetre.add(new JScrollPane(this.fenEtu));
this.fenetre.setLocation(100,100); this.fenetre.revalidate();
this.fenetre.addWindowListener(new ObservateurFenetre());
this.fenetre.setLayout(new GridLayout(1,2));
this.fenetre.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
this.fenetre.add(this.fenGr);
this.fenetre.add(this.fenEtu);
this.fenetre.setVisible(true);
} }
} }