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 74 75 76 77 78 79 80
|
public Iw2Gui()
{
super();
build();
}
public void build(){
Iw2properties fichierprop = new Iw2properties();
fichierprop.load("/iw2.properties");
setTitle("IW2 - Transform");
setLocationRelativeTo(null);
String prop=new String(Iw2properties.getProperty("driver.count"));
Vector elements = new Vector();
int ind = Integer.parseInt(prop);
for (int i=0; i<ind; i++){
elements.add(Iw2properties.getProperty("datasource."+(i+1)));
}
liste1 = new JComboBox(elements);
setSize(new Dimension(290,160));
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setResizable(false);
FlowLayout flowLayout = new FlowLayout();
flowLayout.setAlignment(java.awt.FlowLayout.LEFT);
JPanel pan1=new JPanel();
JPanel pan=new JPanel();
JPanel pan2=new JPanel();
JPanel pan3=new JPanel();
pan.setLayout(new BorderLayout());
pan1.setLayout(flowLayout);
pan2.setLayout(flowLayout);
pan3.setLayout(flowLayout);
JLabel lab=new JLabel("Fichier : ");
pan1.add(lab);
pan1.add(dirfile);
pan1.add(parc);
JLabel lab1= new JLabel("Requête :");
JLabel lab2 = new JLabel("Base de données :");
importb.setBackground(Color.orange);
exportb.setBackground(Color.orange);
edit.setBackground(Color.white);
pan2.add(lab1);
pan2.add(dirreq);
pan1.add(parc);
pan3.setLayout(new FlowLayout());
pan3.add(importb);
pan3.add(exportb);
pan2.add(edit);
pan2.add(lab2);
pan2.add(liste1);
pan.add(pan1, BorderLayout.NORTH);
pan.add(pan2, BorderLayout.CENTER);
pan.add(pan3, BorderLayout.SOUTH);
parc.addActionListener(this);
exportb.addActionListener(this);
importb.addActionListener(this);
edit.addActionListener(this);
setContentPane(pan);
setVisible(true);
} |
Partager