i have this code and im trying to move the button however, it stays as a big block that takes the entire top of the frame.
JFrame f = new JFrame();
f.setTitle("hi");
f.setSize(600,600);
JPanel p = new JPanel();
p.setLayout(new BorderLayout());
JButton b1 = new JButton("Click me!");
b1.setBounds(50, 50, 50, 50);
p.add(b1, BorderLayout.NORTH);
JTextArea l =new JTextArea();
l.setSize(100, 100);
p.add(l,BorderLayout.SOUTH);
ActionListener as = new ActionListener() {
public void actionPerformed(ActionEvent a) {
System.out.println("Husam");
}
};
b1.addActionListener(as);
f.add(p);
f.setVisible(true);
How can i control the position of the button?