This is making a frame having jbutton having size equal to frame and the label is not getting at place which I desired.
public class Try extends JFrame {
public Try(){
JFrame f = new JFrame("TRY");
JButton btn = new JButton(HI);
JLabel l = new JLabel("label");
btn.setBounds(50,100,100,50);
l.setBounds(50,0,100,100);
f.add(btn);
f.add(l);***strong text***
f.setSize(500,500);
f.setVisible(true);
f.getContentPane().setBackground(Color.white);
}
public static void main(String[] args){
Try t = new Try();
}
}