Tweet
import java.awt.*;
import java.applet.*;
/* <applet code="simplebanner" width=300 height=100>
</applet>
*/
public class simplebannner extends Applet implements Runnable
{
String msg = " A banner produced by me ";
Thread t= null;
int state;
boolean stopFlag;
public void init()
{
setBackground(Color.cyan);
setBackground(Color.orange);
}
public void start()
{
t=new Thread(this);
stopFlag=false;
t.start();
}
public void run()
{
char ch;
for(;;)
{
try
{
repaint();
Thread.sleep(250);
ch=msg.charAt(0);
msg=msg.substring(1,msg.length());
msg=msg + ch;
if(stopFlag)
break;
}catch(InterruptedException e){}
}
}
public void stop()
{
stopFlag=true;
t=null;
}
public void paint(Graphics g)
{
g.drawString(msg,75,79);
}
}
Banner Applet in Java using applet
Posted by
LAHAUL SETH
~
Banner Applet in Java using applet
2011-12-16T21:35:00+05:30
LAHAUL SETH
Java
|
Java Applet
|
Comments
Banner Applet in Java using applet
2011-12-16T21:35:00+05:30
LAHAUL SETH
Java
|
Java Applet
|