Results 1 to 1 of 1
Thread: Multiple Layout Managers
- 04-06-2008, 01:43 AM #1
Member
- Join Date
- Apr 2008
- Posts
- 7
- Rep Power
- 0
Multiple Layout Managers
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:
If you can help thanks in advance, any advice is welcomeJava Code: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); } }
Similar Threads
-
Help with JButton and layout
By adlb1300 in forum AWT / SwingReplies: 1Last Post: 12-25-2007, 08:33 AM -
Layout Managers
By gmioannou in forum AWT / SwingReplies: 1Last Post: 12-24-2007, 04:12 AM -
Help with Grid Layout
By coco in forum AWT / SwingReplies: 1Last Post: 08-06-2007, 08:03 PM -
JGraph Layout Pro 1.4.0.3
By levent in forum Java SoftwareReplies: 0Last Post: 07-31-2007, 06:43 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks