jtextarea (seperate lines)

i have to jtextareasthey appear next to each other|====| |=====|but i want them to appear like this|====||====|
[153 byte] By [aaa801a] at [2007-11-27 8:37:49]
# 1
You can use GridLayout(2, 1) to give you 2 rows, 1 column
petes1234a at 2007-7-12 20:35:08 > top of Java-index,Java Essentials,Java Programming...
# 2

Something like this could work:

public class BriefSwing extends JFrame

{

private JTextArea jTextArea1 = new JTextArea(2,20);

private JTextArea jTextArea2 = new JTextArea(2,20);

public BriefSwing()

{

super("My Swing App");

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

initComponents();

pack();

}

private void initComponents()

{

getContentPane().add(myPanel());

}

private JPanel myPanel()

{

JPanel fooPanel = new JPanel();

GridLayout myGridLO = new GridLayout(2, 1);

myGridLO.setHgap(5);

myGridLO.setVgap(5);

fooPanel.setLayout(myGridLO);

fooPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

fooPanel.add(jTextArea1);

fooPanel.add(jTextArea2);

return fooPanel;

}

private static void createAndShowGUI()

{

BriefSwing myBriefSwing = new BriefSwing();

myBriefSwing.setVisible(true);

}

public static void main(String[] args)

{

javax.swing.SwingUtilities.invokeLater(new Runnable()

{

public void run()

{

createAndShowGUI();

}

});

}

}

Message was edited by:

petes1234

petes1234a at 2007-7-12 20:35:08 > top of Java-index,Java Essentials,Java Programming...
# 3
thanks got it done
aaa801a at 2007-7-12 20:35:08 > top of Java-index,Java Essentials,Java Programming...