Transférer les fichiers vers 'src/Test'

This commit is contained in:
2022-12-01 11:58:21 +01:00
parent 1430f84f21
commit e22ee64513
5 changed files with 61 additions and 39 deletions

View File

@@ -5,7 +5,12 @@ import java.awt.*;
import java.awt.event.ActionEvent;
public class MainMenu extends JFrame {
private final static Dimension MINIMUM_SIZE = new Dimension(960, 540);
private CardLayout cards = new CardLayout();
private AdminView av;
private ProfView pv;
private JButton[] buttonTab = {
new JButton("Admin"),
new JButton("Prof"),
@@ -17,11 +22,23 @@ public class MainMenu extends JFrame {
super();
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setExtendedState(MAXIMIZED_BOTH);
//this.setUndecorated(true);
this.setMinimumSize(MINIMUM_SIZE);
init();
this.setVisible(true);
}
private void init() {
BDatabase db = new BDatabase();
Controller listener = new Controller(db);
av = new AdminView(listener.getEtudiants(), listener.getGroupes(), listener);
pv = new ProfView(listener.getEtudiants(), listener.getGroupes(), listener);
this.setLayout(cards);
this.add(first());
this.add(adminView());
this.add(profView());
cards.first(this.getContentPane());
this.setVisible(true);
}
@@ -51,11 +68,21 @@ public class MainMenu extends JFrame {
}
private JPanel adminView() {
JPanel mainPanel = new JPanel
}
private JPanel profView() {
}
private void action(ActionEvent e) {
JButton origin = (JButton) e.getSource();
System.out.println(origin.getText());
BDatabase db = new BDatabase();
Controller listener = new Controller(db);
if (origin.getText() == "Admin") {
listener.createAdminView();