• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTextPane -captured image refreshing problem  RSS feed

 
Anusha Jeyappa
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
In my application it is necessary to capture the
screen and save it as jpeg and display the same in a JTextPane using <img> tag.
I have made use of com.sun.image.codec.jpeg to save the image and it works fine.
After starting the application the
first picture is displayed well but the other pictures though get saved is not displayed in the JTextPane.Only the previous picture remains.
I have made use of new Instance of TextPane each time.All the captured images are saved in the same name say "images/screenshot.jpg" one at a time.
Please tell me what would be the problem.
Expecting your reply
Thanks and Best Regards,
AnushaJv
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch!
The first thing I'd try would be to give a unique name to each saved image and see if that works. If it does, I'd hiss and spit a little bit; otherwise, I'd hiss and spit a little bit.
 
Anusha Jeyappa
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the immediate response.
My requirement is to have a same name for all dynamically generated images.
Is there any option for refreshing!
Anusha Jv
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This post tells you what you need to do.

-Nate
 
Anusha Jeyappa
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The image that is captured is not set directly in any component instead I am using HTML tag <img src...>
This image is shown along with text in the JTextPane.
The text set in the JTextPane changes corectly but the image (same name) doesn't.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!