Ciao a tutti,
Sto lavorando su una JTextArea ma non capisco perché non vuole andare a capo.
Applico il metodo textArea.setWrapStyleWord(true) ma rimane sulla stessa linea.
Questo è un estratto del codice
codice:scrPane = new JScrollPane(); panel2.add(scrPane); textArea = new JTextArea(); scrPane.setViewportView(textArea); scrPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scrPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); textArea.setText(getStrTxt()); textArea.setEditable(false); textArea.setWrapStyleWord(true);
getStrTxt() è il metodo che mi riporta la stringa da inserire all'interno della textArea.
Grazie,
Ciao.![]()

Rispondi quotando