Bookmark Topic Watch Topic
  • New Topic

drawing pictures in JLabel, JPanel  RSS feed

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi all,
below is my snippet:


this actionPerformed() is executed for every 2 seconds. i am displaying continuously 5 pictures in a loop (c:/test1.jpg, c:/test2.jpg...). 5 images are displaying properly. But, they are not of newly updated jpg files. Files used for the 1st loop are used continuously irrespective of newly created files in c: (I am updating these 5 files in c: with another program, updation is proper.). how to show the files properly so that to get motion movie simulation.
please do help.
thanking you.
_________________________[edit]Add code tags and delete extraneous ;. CR[/edit]
[ October 17, 2008: Message edited by: Campbell Ritchie ]
 
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Report post to moderator
How are you calling that actionPerformed? From a javax.swing.Timer?

Why are you not using the % operator? Put your images into an array, then use the % operator to iterate through the array. Don't know why they are not updated; how are you doing that?
 
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please Use One Thread Per Question. Let's continue in this thread. Or not, since you seem to have found a solution.
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Report post to moderator
I hadn't noticed it was a duplicate. Thank you, Rob. Closing.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Still open
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Report post to moderator
Works better if I actually remember to click the padlock icon.

Sorry.
[ October 17, 2008: Message edited by: Campbell Ritchie ]
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!