Hello Members,
How do I change the code below sothat I can have the JLabel at the center of the JFrame and the two JButtons directly below the JLabel?
Thank you!
import java.awt.*;
import javax.swing.*;
public class Layout {
public static void main (String args[])
{
JFrame m = new JFrame("Testing");
JButton p = new JButton ("Button_1");
JButton q = new JButton ("Button_2");
JLabel r = new JLabel();
r.setText("Enter your value here");
m.add(r);
m.add(p);
m.add(q);
m.setSize(500, 500);
m.setVisible(true);
m.getContentPane().setLayout(new FlowLayout());
}
}