Here is my java code:
JLabel persAdi,persSoyadi,persKodu,ust,alt;
JTextField ad,soyad,tckimlikno;
JButton bul,iptal;
public persBul(){
setSize (400,600);
setResizable(false);
setLocation (20, 20);
setVisible(true);
Container icerik = getContentPane();
icerik.setLayout(null);
icerik.getX();
ust=new JLabel("Bulmak İstediğiniz Personelin;");
ust.setBounds(10, 10, 200, 30);
icerik.add(ust);
persAdi=new JLabel("Adı:");
persAdi.setBounds(10,40,80,15);
icerik.add(persAdi);
ad=new JTextField();
ad.setBounds(50, 40, 80, 20);
icerik.add(ad);
persSoyadi=new JLabel("Soyadı:");
persSoyadi.setBounds(10, 180, 80, 30);
icerik.add(persSoyadi);
soyad=new JTextField();
soyad.setBounds(200, 40, 100, 30);
Icon bulPng=new ImageIcon(getClass().getResource("search.png"));
Icon iptalPng=new ImageIcon(getClass().getResource("cancel.png"));
bul=new JButton("",bulPng);
bul.setBounds(20, 120, 40, 40);
icerik.add(bul);
iptal=new JButton("",iptalPng);
iptal.setBounds(90, 120, 40, 40);
icerik.add(iptal);
}
public static void main(String[] args){
persBul app=new persBul();
}
When I debug this code, my JTextField
doesn't appear. Only first JLabel
can appear and I don't see any other JLabel
or JTextField
or JButton
. My button appears when my cursor is on it. I have to do this project but I haven't created the user interface yet. Can anybody help me?