Hi.
I'm using some JTextArea in my Swing application. The surrounded JScrollPane is added to a JPanel using the GridBagLayout manager.
// Pseudo Code ----
JTextArea area = new JTextArea();
area.setRows(3);
JScrollPane sp = new JScrollPane(area);
JPanel p = new JPanel(new GridBagLayout());
p.add(sp, new GridBagConstraints(
0, 0, 1, 1, 1, 0, WEST, HORIZONTAL, new Insets(4, 4, 4, 4), 0, 0));
// ----------------
Everything works fine. No problem at all until I will resize the JFrame. Then both JTextArea will collapse to one row. However there is enough place for at least one of them.
Why the element collapse to one row?
Does anyone know a solution? Has anyone an idea?
Thank you in advance!
Best Regards
Zubi