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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
| import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import javax.swing.*;
public class Mafenetre extends JFrame {
public static String adresse;
public Mafenetre(){
super("TAPER VOTRE TEXTE");
build();
}
JPanel PanelRecherche(){
JPanel panel = new JPanel();
panel.setLayout(new FlowLayout());
//this.setSize(150, 150);
JTextField text =new JTextField();
//panel.add(text,BorderLayout.NORTH);
panel.add(text);
text.setSize(150,15);
text.setText("fsdvfd"+adresse);
text.setColumns(25);
text.setFont(new Font("Arial", 1, 15));
//panel.add(text);
JButton btnP = new JButton(new Mondossier());
panel.add(btnP,BorderLayout.EAST);
//panel.add(btnP);
btnP.setSize(35,15);
btnP.setToolTipText("Parcourir");
btnP.setFont(new Font("Arial", 1, 15));
return panel;
}
private JPanel PanelIntitule(){
JPanel panel1 = new JPanel();
panel1.setLayout(new FlowLayout());
JButton btn1 = new JButton();
//add(btn1,BorderLayout.SOUTH);
panel1.add(btn1);
btn1.setSize(50,25);
btn1.setText("BANQUE");
btn1.setFont(new Font("Arial", 1, 35));
JButton btn2 = new JButton();
//add(btn2,BorderLayout.CENTER);
panel1.add(btn2);
btn2.setSize(50,25);
btn2.setText("COMPTE");
btn2.setFont(new Font("Arial", 1, 35));
JButton btn3 = new JButton();
//add(btn3,BorderLayout.SOUTH);
panel1.add(btn3);
btn3.setSize(50,25);
btn3.setText("CLIENT");
btn3.setFont(new Font("Arial", 1, 35));
return panel1;
}
private void build(){
setTitle("Banque DE KHALID");
setSize(640,480);
setLocationRelativeTo(null);
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(new FlowLayout());
//this.setLayout(new FlowLayout());
this.add(PanelRecherche());
this.add(PanelIntitule());
}
public String getAdresse() {
return adresse ;
}
public void setAdresse(String cheadresse) {
cheadresse = adresse ;
}
public void affiche(String adresse){
return ;
}
public static void main(String[] args) {
Mafenetre fnt = new Mafenetre();
fnt.setVisible(true);
}
} |
Partager