File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes making the message wrap in a JDialog Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "making the message wrap in a JDialog" Watch "making the message wrap in a JDialog" New topic
Author

making the message wrap in a JDialog

Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4339
    
    2

i have the following code which works ok except the message doesn't wrap, so the JDialog(the lucky recipient of the return value from getMessage()), is one long...long...long..line


can i perhaps set the width of the JDialog?


SCJP
Visit my download page
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
set it as the text of a JTextArea (in scrollPane) with lineWrap set to true
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4339
    
    2

it is one of several classes that implement the same interface. the main program treats them all the same using a JDialog to display the message

i suppose i could add some newline characters, but after what i had to do to turn it into a string in the first place
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4339
    
    2

well it's ugly but it works
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
I still think it's simpler with a textArea.
Run this to see what it looks like.



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: making the message wrap in a JDialog
 
Similar Threads
Dynamic table not displaying.
Euler problem 8
Requested source is not available
Equivalent of logic iterate in Struts 2
Jstl not reflecting values back to servlet