MigLayout JTextArea is not shrinking when used with linewrap=true

Posted by Marcel on Stack Overflow See other posts from Stack Overflow or by Marcel
Published on 2010-03-19T08:10:19Z Indexed on 2010/04/29 16:47 UTC
Read the original article Hit count: 622

Filed under:
|
|
|

Hi. If I use a JTextArea with MigLayout like this:

MigLayout thisLayout = new MigLayout("", "[][grow]", "[]20[]");
   this.setLayout(thisLayout);
   {
jLabel1 = new JLabel();
this.add(jLabel1, "cell 0 0");
jLabel1.setText("jLabel1");
  }
  {
 jTextArea1 = new JTextArea();
this.add(jTextArea1, "cell 0 1 2 1,growx");
jTextArea1.setText("jTextArea1");
jTextArea1.setLineWrap(false);
   } 

then the JTextArea grows and shrinks perfectly when resizing the window. When I set the linewrap to true the JTextArea is not shrinking when I make the window smaller again. I would very much appreciate any help. Thanks

Marcel

© Stack Overflow or respective owner

Related posts about miglayout

Related posts about java