File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changing the display of an applet dynamically on a web application.

 
VineetK Singh
Ranch Hand
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am building a simple web-app with an applet embedded in a JSP. This applet on being loaded the first time, displays a 2D image. It also has a button on it, which on being clicked, contacts a servlet. The servlet now sends a new set of co-ordinates for a new shape , to the applet.

Now when I run the applet as a standalone applet, the communication works fine, the new image is drawn over the default image. But once the applet is loaded on being embedded in the JSP, the image change doesn't take place. The image doesn't change even after refreshes of the page.

Any ideas how to achieve this task???
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is the drawing being done - in a paint or paintComponent method? Is the calling of those methods being triggered after obtaining the new data? If not, you may want to insert appropriate "repaint" or "update" method calls.
 
VineetK Singh
Ranch Hand
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the paint method. I have tried using the repaint and update method, but they don't help.

As you can see, one rectangle is drawn when the the apllet is loaded for the first time. The second rectangle has a variable result, which is obtained from the servlet, after the button on the applet is hit. The mechanism is working fine when applet is run as a standalone app, but fails when embedded in the JSP.
 
VineetK Singh
Ranch Hand
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Ulf and my apologies for the last post. The repaint method is working fine.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic