// Creating buttons
JButton b1 = new JButton();
b1.setText("Add");
b1.setSize(100, 130);
b1.setLocation(330, 70);
b1.setBackground(Color.red);
b1.setVisible(true);
// Creating second button
JButton b2 = new JButton();
b2.setText("Add");
b2.setSize(100,100);
b2.setLocation(0, 0);
b2.setBackground(Color.blue);
b2.setVisible(true);
//adding buttons to Jframe
f.add(b1);
f.add(b2);
The buttons don't appear when I run the program or sometimes, they do appear, but take up the whole JFrame
completely