[70] in java-interest
Modifing ImageLoopItem is a special way
daemon@ATHENA.MIT.EDU (Wombat)
Tue May 9 14:21:32 1995
Date: Tue, 9 May 1995 04:40:12 -0400 (EDT)
From: Wombat <colin@nando.net>
To: java-interest@java.Eng.Sun.COM
Below is a much too long program that doesn't do what I want. I want to
have a series of four pictures that change ever few seconds, but not all
at once. The four pictures should be side-by-side. I want the first one to
paint, then the second, then the third, then the fourth and then start
back with number one, then two, etc.
I've had limited success. I also need to get it to it does is forever (or
until the user goes to a different URL, of course). Like the TickerTape
will scroll forever, I want these pictures to swap-out forever. I'm going
to limit myself to 16 photos: 4 for each of the 4 areas.
I've tried modifing ImageLoopItem and can have all four pictures swap-out
at one to be replaced with new ones, but I can't get a delay between the
four areas to be swapped out.
If there is anyone out there who could help me, I'd be grateful.
Colin Boatwright
Colin@NandO.net
--- BEGIN JAVA PROGRAM ---
import java.io.InputStream;
import awt.*;
import browser.*;
import net.www.html.*;
public
class Viper extends Applet implements Runnable {
String date;
int startx;
Image logo;
Image pic1;
Image pic2;
Image pic3;
Image pic4;
Image pic5;
Image pic6;
Image pic7;
Image pic8;
Image pic9;
Image pic10;
Image pic11;
Image pic12;
Image pic13;
Image pic14;
Image pic15;
Image pic16;
Thread kicker = null;
public void init() {
pic1 = getImage(getAttribute("pic1"));
pic2 = getImage(getAttribute("pic2"));
pic3 = getImage(getAttribute("pic3"));
pic4 = getImage(getAttribute("pic4"));
pic5 = getImage(getAttribute("pic5"));
pic6 = getImage(getAttribute("pic6"));
pic7 = getImage(getAttribute("pic7"));
pic8 = getImage(getAttribute("pic8"));
pic9 = getImage(getAttribute("pic9"));
pic10 = getImage(getAttribute("pic10"));
pic11 = getImage(getAttribute("pic11"));
pic12 = getImage(getAttribute("pic12"));
pic13 = getImage(getAttribute("pic13"));
pic14 = getImage(getAttribute("pic14"));
pic15 = getImage(getAttribute("pic15"));
pic16 = getImage(getAttribute("pic16"));
logo = getImage(getAttribute("logo"));
date = getAttribute("date");
startx = logo.width+10;
Viper kicker = new Viper();
resize(515,logo.height);
}
public void run() {
Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
repaint();
kicker = new Thread(this);
kicker.start();
}
public void paint(Graphics g) {
resize(515,logo.height);
g.drawImage(logo, 0, 0);
g.drawImage(pic1, logo.width+ 10, 0);
Thread.sleep(1000);
g.drawImage(pic2, logo.width+ 90, 0);
Thread.sleep(1000);
g.drawImage(pic3, logo.width+170, 0);
Thread.sleep(1000);
g.drawImage(pic4, logo.width+250, 0);
Thread.sleep(1000);
g.drawImage(pic5, logo.width+ 10, 0);
Thread.sleep(1000);
g.drawImage(pic6, logo.width+ 90, 0);
Thread.sleep(1000);
g.drawImage(pic7, logo.width+170, 0);
Thread.sleep(1000);
g.drawImage(pic8, logo.width+250, 0);
Thread.sleep(1000);
{ETC, ETC.}
}
public void start() {
kicker = new Thread(this);
kicker.start();
repaint();
}
public void stop() {
kicker = new Thread(this);
kicker.start();
repaint();
}
}
-------------------------------------
Colin B. Boatwright (Colin@NandO.net)
Assistant Temporary Deputy Transitory Interim Lieutenant Associate Webmaster
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com