Results 1 to 5 of 5

Thread: Help Error

  1. #1
    ravjot28 is offline Member
    Join Date
    Jun 2008
    Posts
    87
    Rep Power
    0

    Default Help Error

    import java.applet.*;
    import java.awt.*;
    public abstract class banner extends Applet implements Runnable {
    String msg="My New Banner";
    Thread t=null;
    int state;
    boolean stop;
    public void init(){
    setBackground(Color.RED);
    setForeground(Color.black);
    }
    public void start(){
    t=new Thread(this);
    t.start();
    stop=false;
    }
    public void run(){
    char ch;
    for(;;){
    try{
    repaint();
    Thread.sleep(1000);
    ch=msg.charAt(0);
    msg=msg.substring(1,msg.length());
    msg+=ch;
    if(stop){
    break;
    }
    }catch(InterruptedException e){

    }
    }
    }
    public void stop(){stop=true;
    t=null;
    }
    public void paint(Graphics g){
    g.drawString(msg, 20, 56);
    }
    }

  2. #2
    ravjot28 is offline Member
    Join Date
    Jun 2008
    Posts
    87
    Rep Power
    0

    Default

    this gives the error that applet not initialize

  3. #3
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    8

    Default

    Well, of course it can't be initialised when you've declared the Class abstract.

  4. #4
    ravjot28 is offline Member
    Join Date
    Jun 2008
    Posts
    87
    Rep Power
    0

    Default

    ohhh thanks alot

  5. #5
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    And don't forget to inclose the java code with code tags next time :)
    freedom exists in the world of ideas

Similar Threads

  1. error 530 error authentication required
    By rgale in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 05-12-2008, 04:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •