hi, this is my code to display one textarea, textfield and label in the flowlayout.
and 2*2 button
/**
* @(#)Gui.java
*
*
* @author
* @version 1.00 2010/10/5
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Gui extends JFrame{
JButton b1=new JButton("one");
JButton b2=new JButton("two");
JButton b3=new JButton("three");
JButton b4=new JButton("four");
JTextArea textarea1=new JTextArea(10,30);
JLabel label1=new JLabel();
JTextField textfield1=new JTextField(30);
public Gui() {
JFrame f=new JFrame();
f.setLayout(new BorderLayout());
Container c=f.getContentPane();
JPanel p1=new JPanel();
p1.setLayout(new GridLayout(2,2));
JPanel p2=new JPanel();
p2.setLayout(new FlowLayout());
p1.add(b1);
p1.add(b2);
p1.add(b3);
p1.add(b4);
p2.add(textarea1);
p2.add(label1);
p2.add(textfield1);
c.add(p1);
c.add(p2);
f.show();
f.setSize(200,300);
}
public static void main(String args[]){
new Gui();
}
}