Here is a screenshot of my JFrame
. This will be the main window to my application.
So the problem is that all the buttons are inline with each other, whereas I want them to be one under the other i.e. Add Contact
under Show Contacts
.
So how can I do that?
Here is my code for the JFrame
.
public class CRUDFrame extends JFrame {
public CRUDFrame(){
super("AppCRUD");
setLayout(new FlowLayout());
JButton button1, button2, button3, button4;
button1 = new JButton(" Show Contacts ");
button2 = new JButton(" Add Contact ");
button3 = new JButton(" Update Number in a Contact ");
button4 = new JButton(" Delete a Contact ");
add(button1);
add(button2);
add(button3);
add(button4);
}
}
`