Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > JAVA > Image Update in Applet?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-10-03, 03:01
Narayanaswamy Narayanaswamy is offline
Registered User
 
Join Date: Sep 2003
Posts: 4
Unhappy Image Update in Applet?

Hai ,
I want to load images dynamically to my applet.
I have four file names..
String fileNames[] = {"test1.png","test2.png","test3.png","test4.png"};

I want to load the images one at a time to my applet I am using the code

public void paint(Graphics g){
i= (i+1)%4;
Image img = getImage(getCodeBase(),fileNames[i]);
g.drawImage(img,0,0,null);
}

Now I have two threads
one will update the images for every second
such that the updation will take place in a cycle ( only one file will be changed at a time..)
Another will call the repaint()

I can able to see that the images are updated by another thread but the updated images are not loaded by the applet insted the images that were present at the time of starting the applet is repeated.

How can i get the updated images into the Applet.

Thanks
Narayanaswamy
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On