Actualiser src/fr/iutfbleau/papillon/Main.java
This commit is contained in:
@@ -9,7 +9,7 @@ public class Main extends JFrame {
|
|||||||
super("Papillon");
|
super("Papillon");
|
||||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
|
||||||
// ----- Titre en haut -----
|
// Titre en haut
|
||||||
JLabel titre = new JLabel("Rappel : Papillon", SwingConstants.CENTER);
|
JLabel titre = new JLabel("Rappel : Papillon", SwingConstants.CENTER);
|
||||||
titre.setBorder(BorderFactory.createEmptyBorder(6,10,6,10));
|
titre.setBorder(BorderFactory.createEmptyBorder(6,10,6,10));
|
||||||
titre.setBackground(Color.CYAN);
|
titre.setBackground(Color.CYAN);
|
||||||
@@ -75,10 +75,21 @@ public class Main extends JFrame {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFenetre(){
|
|
||||||
FenetreAjout update = new FenetreAjout();
|
|
||||||
update.setVisible(true);
|
public void ouvrirFenetreAjout() {
|
||||||
|
FenetreAjout f = new FenetreAjout(this);
|
||||||
|
// cacher la fenetre actuelle et montrer celle d ajout
|
||||||
|
|
||||||
|
// récupère la position actuelle de Main
|
||||||
|
Point pos = this.getLocation();
|
||||||
|
f.setLocation(pos); // place FenetreAjout au même endroit
|
||||||
|
|
||||||
|
f.setVisible(true);
|
||||||
|
this.setVisible(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
Main f = new Main();
|
Main f = new Main();
|
||||||
|
|||||||
Reference in New Issue
Block a user