Line wrap in a JTextArea causes JScrollPane to missbehave with MiGLayout

前端 未结 4 2013
轻奢々
轻奢々 2021-02-10 01:58

I am having trouble with the same thing as this guy:

MigLayout JTextArea is not shrinking when used with linewrap=true

and I used the solution described in one o

4条回答
  •  长情又很酷
    2021-02-10 02:38

    Normally, you would put the JTextArea into your JScrollPane. Like this:

    JTextArea area = new JTextArea();
    JScrollPane scroll = new JScrollPane(area);
    JPanel panel = new JPanel();
    panel.add(scroll);
    

提交回复
热议问题