correctif et debut gui

senquenceDiagram
NicolasFau 5 years ago
parent ee99ac0ae2
commit 2a82719e38

@ -0,0 +1,60 @@
/**
*
*/
package gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GraphicsConfiguration;
import java.awt.HeadlessException;
import java.nio.file.attribute.AclEntry.Builder;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import org.eclipse.swt.SWT;
/**
* @author nicolas
*
*/
public class jeu extends JFrame {
public jeu() {
super();
build();
}
public void build() {
setTitle("Jeu");
setSize(800,600);
setLocationRelativeTo(null);
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel center = new JPanel();
Dimension taille = new Dimension(200,200);
center.setPreferredSize(taille);
center.add(new JButton("Jouer"));
this.setLayout(new BorderLayout());
this.getContentPane().add(buildContentPane(), BorderLayout.NORTH);
this.getContentPane().add(center, BorderLayout.CENTER);
}
public JPanel buildContentPane() {
JPanel panel =new JPanel();
Dimension preferredSize = new Dimension(200,200);
panel.setLayout(new FlowLayout());
JLabel label = new JLabel("Jeu Dragon Donjon");
panel.add(label);
return panel;
}
}

@ -0,0 +1,31 @@
/**
*
*/
package gui;
import java.awt.Dialog;
import javax.swing.SwingUtilities;
/**
* @author nicolas
*
*/
public class main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
SwingUtilities.invokeLater(new Runnable(){
public void run(){
//On crée une nouvelle instance de notre JDialog
jeu fenetre = new jeu();
fenetre.setVisible(true);//On la rend visible
}
});
}
}
Loading…
Cancel
Save