This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes can i show ImageIcon within JTextArea ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "can i show ImageIcon within JTextArea ?" Watch "can i show ImageIcon within JTextArea ?" New topic
Author

can i show ImageIcon within JTextArea ?

sarim raza
Ranch Hand

Joined: Nov 02, 2000
Posts: 232
I have a JTextArea that displays textual results
sometimes i want to display an image (jpg etc)
in that place. Can i attach the image to the
JTextArea or do i need to get rid of it first and
just attach it to the JPanel ?
thanks
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
I don't think you can display an image inside a text area. either you use jtextpane, or jeditorpane, or you do as you suggested: get rid of the text area and use - not a jpanel, but a jlabel (and set the image as its (Image)Icon). if the jpgs are of limited number you could use a card layout. it is fast and you won't have to bother with any repainting logic which sometimes can be quite annoying.
cheers
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can i show ImageIcon within JTextArea ?
 
Similar Threads
How to implment Undo/Redo for a editor
wraping in JTable cell
soap mulitple image attachements.
Attach Image in JSP
how to delete multiple browse