aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Newbie Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Newbie Question" Watch "Newbie Question" New topic
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
try this

tan kian
Ranch Hand

Joined: Apr 09, 2004
Posts: 40
i've tried it, but its no use =(
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Newbie Question
 
Similar Threads
this keyword explaination please
Layout problems!!
Very Very New
Trouble executing(actionlistener) the swing applet properly in html
How to add components to JFrame after coloring the JFrame