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