I have just made a banner in java applets and in status window also i have used a banner but in reverse direction to that of the other banner but the banner in status window does not make use of the whole space of the window and just runs in a small space and it's the case wherever i run that banner in that particular direction....
Here's my code
import java.awt.*;
import java.applet.*;
/*
<applet code="Hello" width=300 height=50>
</applet>
*/
public class Hello extends Applet implements Runnable
{
String msg=" Hello";
String msg1=" hello";
Thread t=null;
boolean stopFlag;
public void init()
{
setBackground(Color.cyan);
setForeground(Color.red);
}
public void start()
{
t=new Thread(this);
stopFlag=false;
t.start();
}
public void run()
{
char ch,ch1;
for(; ;)
{
try{
repaint();
Thread.sleep(100);
ch=msg.charAt(5);
msg=msg.substring(0,msg.length());
msg=ch+msg;
ch1=msg1.charAt(0);
msg1=msg1.substring(1,msg1.length());
msg1+=ch;
showStatus(msg1);
if(stopFlag)
break;
}
catch(InterruptedException e){}
}}
public void stop()
{
stopFlag=true;
t=null;
}
public void paint(Graphics g)
{
g.drawString(msg,10,30);
}}
I asked the same thing from my teacher and he said that your even your banner is not correct..The way its running its all right..
And to make it use the whole space , its not in your hand but i don't believe him , i guess..