aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Word wrap in JTextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Word wrap in JTextArea" Watch "Word wrap in JTextArea" New topic
Author

Word wrap in JTextArea

Flo Powers
Ranch Hand

Joined: May 12, 2004
Posts: 57
Hi, I am in the process of learning about Swing and have a question regarding the use of JTextAreas. I searched this thread for previous posts on the topic but didn't find anything that solved my problem.

The below code works fine in the appletviewer, but not when embedded in a web page. That is, the inputdialogs work but not the messagedialog, and the text in the outputArea only shows the last word in input.



The messagedialog was just there to test that it was actually inputting the text correctly, but it doesn't actually show when viewed in the web page, so I thought I'd inquire about that as well.

Thanks!
[ October 20, 2005: Message edited by: Flo Powers ]
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
it looks OK.
perhaps if you posted the entire applet code, we could run it and observe the behaviour
dave taubler
Ranch Hand

Joined: May 15, 2001
Posts: 132
Your subject title mentioned word wrap, so I assume you're having some issue with that. Try including

outputArea.setWrapStyleWord(true)


Dave Taubler<br />Specializing in <a href="http://taubler.com/articles/" target="_blank" rel="nofollow">Java and Web Development</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Word wrap in JTextArea