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 73
|
package monpackage;
import java.awt.BorderLayout;
import java.awt.Image;
import java.awt.Point;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.JPanel;
import javax.swing.JFrame;
import java.awt.Dimension;
public class Acceuil extends JFrame {
private static final long serialVersionUID = 1L;
private JPanel jContentPane = null;
/**
* This is the default constructor
* @throws IOException
*/
public Acceuil() throws IOException {
super();
initialize();
}
public static void main(String args[]){
try {
new Acceuil();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* This method initializes this
*
* @return void
* @throws IOException
*/
private void initialize() throws IOException {
this.setSize(1000, 550);
this.setContentPane(getJContentPane());
this.setTitle("JFrame");
}
/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
* @throws IOException
*/
private JPanel getJContentPane() throws IOException {
if (jContentPane == null) {
jContentPane = new JPanel();
jContentPane.setLayout(new BorderLayout());
Image image = ImageIO.read(Acceuil.class.getResource("/composants/lignes.png"));
Composant c=new Composant("texte", image);
PanneauComposant pc = new PanneauComposant();
ComposantTransferable cp=new ComposantTransferable(c);
pc.ajouterComposant(cp);
DropZone dz=new DropZone();
dz.setPreferredSize(new java.awt.Dimension(500,500));
pc.setPreferredSize(new java.awt.Dimension(300,500));
pc.add(c, null);
//dz.insert(c);
jContentPane.add(pc,BorderLayout.WEST);
jContentPane.add(dz,BorderLayout.CENTER);
}
return jContentPane;
}
} // @jve:decl-index=0:visual-constraint="14,15" |