File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Icon in JTextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Icon in JTextArea" Watch "Icon in JTextArea" New topic

Icon in JTextArea

Sachin dev

Joined: Aug 15, 2001
Posts: 7
hi ,
Is it possible to insert or paint an Icon in JTextArea and whenever needed ,it should be removed,I also want editable text inside my JTextArea.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300

I don't think so. Not with a JTextArea.
You could use a JEditorPane or JTextPane probably though. Since it will accept HTML. And it is still Editable.

GenRocket - Experts at Building Test Data
Sachin dev

Joined: Aug 15, 2001
Posts: 7
Thanx ,Mr/Ms Gregg Bolinger
Could u please reply with more details(icon in JTextPane or JEditorPane) ,if possible with a example
It is sorta covered in the JavaRanch Style Guide.
subject: Icon in JTextArea