Author
Newbie Question
tan kian
Ranch Hand
Joined: Apr 09, 2004
Posts: 40
i've just learned java GUI for a few days, so heres a pretty basic question: all i wanna do is to make this interface below. ------------------------------------- Buttons here | ------------------------------------| | Panel for displaying other things | | | ------------------------------------- but this is the interface i keep getting: ---------------------------------- | | buttons here | display here | | | | | | | | | | | | | ---------------------------------- heres my code. Can someone help? JButton yes = new JButton ("Yes"); JButton no = new JButton ("No"); JButton maybe = new JButton ("Maybe"); public Tgui() { JPanel pn = new JPanel (); JPanel display = new JPanel (); Container container = getContentPane(); container.setLayout(new GridLayout (9,1)); Container displayer = getContentPane(); displayer.setLayout(new GridLayout (1,1)); pn.add(yes); pn.add(no); pn.add(maybe); container.add(pn); display.setBackground(Color.white); displayer.add(display); setTitle("Test"); } public static void main(String [] args) { Tgui t = new Tgui(); t.setSize(640,420); t.setLocation(30,30); t.setVisible(true); t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); }
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted Oct 01, 2004 12:35:00
0
try this
tan kian
Ranch Hand
Joined: Apr 09, 2004
Posts: 40
i've tried it, but its no use =(
subject: Newbie Question