Is this your first time here? SwingWiki is a Java Swing Developer community site with an big archive of Swing-related usenet groups and mailing lists, but also tips, tricks and articles and book reviews written by your colleagues from around the world. If you came here through a search engine and did not find what you were looking for, make sure to check the wiki table of contents.

JTextArea wordwrap

Wordwrap is supported by JTextArea, but it must be activated as a two-step process. First, you should activate line breaking (called linewrap), and then set wrap style to words, and not characters.

Remember to disable editing if you are just displaying text.

JTextArea messageField=new JTextArea();
messageField.setEditable(false);
messageField.setLineWrap(true);
messageField.setWrapStyleWord(true);
 

Comments? Corrections? Contact us or Login to edit pages directly (registration is free and takes less than displaying a JLabel)
  howto/jtextarea_wordwrap.txt · Last modified: 2005/03/13 12:59 by 195.137.75.14 (gojko)
 
Recent changes | RSS changes | Table of contents | News Archive | Terms And Conditions | Register | The Quest For Software++| Ruby Resources

Sedo - Buy and Sell Domain Names and Websites project info: swingwiki.org Statistics for project swingwiki.org etracker� web controlling instead of log file analysis