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
| package gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.UIManager;
import app.Lecture;
import gui.Fichier;
import gui.Menu;
import gui.Messages;
public class MainFrame extends JFrame {
private static final long serialVersionUID = 7049374693583063883L;
private static MainFrame instance = new MainFrame();
Lecture lecture;
Fichier fichier;
Menu menuBar;
Messages msg;
private JPanel jContentPane = null;
public MainFrame() {
super();
lecture = new Lecture();
fichier = new Fichier(this);
menuBar = new Menu(this);
msg = new Messages(this);
initialize();
}
public static MainFrame getInstance() {
return instance;
}
private void initialize() {
try {
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
}
catch (Exception e) {
e.printStackTrace();
}
this.setTitle("Gestion de Prêts");
this.setJMenuBar(menuBar);
this.setPreferredSize(new Dimension(900,700));
this.setResizable(false);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setContentPane(getJContentPane());
this.pack();
this.setVisible(true);
}
private JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new JPanel();
jContentPane.setLayout(new BorderLayout());
}
return jContentPane;
}
public Lecture getLecture() {
return lecture;
}
public void setLecture(Lecture lecture) {
this.lecture = lecture;
}
} |
Partager