Results 1 to 12 of 12
Thread: every weak 4 images comes,
- 08-31-2008, 11:43 AM #1
Member
- Join Date
- Jun 2008
- Posts
- 54
- Rep Power
- 0
- 08-31-2008, 02:24 PM #2
You'll have to show your code for anyone to be able to suggest how to change it to show the new images.
One solution would be to list the images to be shown in a file and have the app read the file to get the names of the images to be shown.
- 09-01-2008, 07:32 AM #3
Member
- Join Date
- Jun 2008
- Posts
- 54
- Rep Power
- 0
- 09-01-2008, 09:38 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Use a swing timer to change image. Set the timer to 7 days and load the image into the required place.
- 09-01-2008, 10:49 AM #5
Senior Member
- Join Date
- Aug 2008
- Posts
- 384
- Rep Power
- 5
Or use a thread, or just use date, it all works. You should google for the 'correct' code.
I die a little on the inside...
Every time I get shot.
- 09-01-2008, 11:02 AM #6
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Ya, lots of choices there, depends on the implementation choose the best.
- 09-01-2008, 01:12 PM #7
Senior Member
- Join Date
- Aug 2008
- Posts
- 384
- Rep Power
- 5
For once every seven days I would choose to compare the date every now and then. ;) I think that would be best - least memory-consuming, but I may be wrong, correct me if so. :)
I die a little on the inside...
Every time I get shot.
- 09-01-2008, 02:30 PM #8
How does the program access the images? Are they in a folder with all the previous images? What controls where the new images are placed?So every weak 4 images comes
- 09-01-2008, 03:05 PM #9
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 09-01-2008, 04:24 PM #10
Senior Member
- Join Date
- Aug 2008
- Posts
- 384
- Rep Power
- 5
True, I just thought of the fact that you had to check it every now and then, and needed a timer for that anyways, so, indeed, it doesn't really matter what you use, although I prefer Threads.
I die a little on the inside...
Every time I get shot.
- 09-02-2008, 04:55 AM #11
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
I think so, threads are much safer. But if you are dealing with in GUI implementation swing timer could be better too.
- 09-02-2008, 05:01 AM #12
Normal good design practice is to set a thread with a wakeup (sleep()) time that wakes up before your deadline. Wake up, see if the deadline has passed, if not sleep for 75% more.
This way, if your code dies or if the timers are off a bit, you can be safe.
This is also a good time to check that your computer is using a NTP pool server for time.
Similar Threads
-
XML Images
By JavaWizz in forum XMLReplies: 1Last Post: 10-17-2008, 10:19 AM -
images
By amith in forum AWT / SwingReplies: 3Last Post: 06-27-2008, 08:38 PM -
images
By amith in forum AWT / SwingReplies: 1Last Post: 05-20-2008, 10:54 AM -
Help with images...
By toby in forum Java AppletsReplies: 1Last Post: 08-04-2007, 05:25 AM -
Images in JSP
By Daniel in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 06-05-2007, 06:01 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks