hi, i'm trying to create a user interface using layout managers except i don't know which one to use, as i think that i need to use different layout manager for different parts
i am aiming to have the title at the top of the applet and the JTextArea directly underneath this with 4 radio buttons underneath
my first thought was to use the BoxLayout Manager however my radio buttons go underneath each other instead of in a line.
This is the current code that i have so far:
class Page2 extends JFrame
{
public Page2()
{
super ("Multiple Choice Questions");
setSize (600,600);
Container p = getContentPane();
p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
JLabel title = new JLabel("TEST QUESTIONS");
p.add(title);
JTextArea area = new JTextArea(1,1);
area.setEditable(false);
p.add(area);
JRadioButton A = new JRadioButton("A");
p.add(A);
JRadioButton B = new JRadioButton("B");
p.add(B);
JRadioButton C = new JRadioButton("C");
p.add(C);
JRadioButton D = new JRadioButton("D");
p.add(D);
}
}
If you can help thanks in advance, any advice is welcome