File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Newbie Question Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply 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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Newbie Question
 
Similar Threads
this keyword explaination please
Layout problems!!
How to add components to JFrame after coloring the JFrame
Very Very New
Trouble executing(actionlistener) the swing applet properly in html