I have a JTextArea and it's currently just displayed as a thin line, I can't get it to resize, it won't do anything. It's just too small and won't adjust no matter what properties I change. Can anyone suggest a solution?
private JTextArea outputT;
I adjust the properties:
outputT = new JTextArea(5, 20);
outputT.setMargin(new Insets(5, 5, 5, 5));
outputT.setEditable(false);
outputT.setPreferredSize(new Dimension(550, 50));
is required
put JTextArea to JScrollPane
set intial size for JTextArea(int, int) accepted by
LayoutManager
(andJFrame.pack()
)use proper LayoutManager in the case that you want to set
Min
/Max
/PreferredSize
for (JTextArea
placed in)JScrollPane