why this Applet fails

Discussion in 'Java' started by Madhur Ahuja, Nov 3, 2004.

  1. Madhur Ahuja

    Madhur Ahuja Guest

    Hello

    This Applet runs fine as an application but
    does not displays output in the console window as
    it does in the application.

    Any ideas?


    import java.applet.*;
    import java.awt.*;


    public class Applet2 extends Applet
    {

    public Applet2()
    {

    Thread ff=new Thread( new Runnable()
    {

    public void run()
    {
    for(int i=0;i<10000;++i)
    {
    System.out.println(i);

    try
    {

    Thread.sleep(100);
    }
    catch(Exception e)
    {
    e.printStackTrace();
    }
    }
    }


    });
    ff.start();
    }

    public static void main(String args[])
    {
    new Applet2();
    }

    }

    --
    Madhur Ahuja [madhur<underscore>ahuja<at>yahoo<dot>com]

    Homepage
    http://madhur.netfirms.com
     
    Madhur Ahuja, Nov 3, 2004
    #1
    1. Advertising

  2. On Wed, 3 Nov 2004 16:32:16 +0530, Madhur Ahuja wrote:

    > This Applet runs fine as an application but
    > does not displays output in the console window ....


    What browser? What Java?
    <http://www.physci.org/pc/property.jsp?prop=java.version>

    > ...as it does in the application.


    It displays continuous numbers when run from AppletViewer.
    Ditto for IE 6 running Java 1.5.0.

    What did I (or you) miss?

    --
    Andrew Thompson
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.PhySci.org/ Open-source software suite
    http://www.1point1C.org/ Science & Technology
    http://www.LensEscapes.com/ Images that escape the mundane
     
    Andrew Thompson, Nov 3, 2004
    #2
    1. Advertising

  3. Madhur Ahuja

    Madhur Ahuja Guest

    Andrew Thompson <> wrote:
    > On Wed, 3 Nov 2004 16:32:16 +0530, Madhur Ahuja wrote:
    >
    >> This Applet runs fine as an application but
    >> does not displays output in the console window ....

    >
    > What browser? What Java?
    > <http://www.physci.org/pc/property.jsp?prop=java.version>
    >
    >> ...as it does in the application.

    >
    > It displays continuous numbers when run from AppletViewer.
    > Ditto for IE 6 running Java 1.5.0.
    >
    > What did I (or you) miss?


    Thanks, the problem was that I was using the old class file.
    My Bad. Thanks !

    --
    Madhur Ahuja [madhur<underscore>ahuja<at>yahoo<dot>com]

    Homepage
    http://madhur.netfirms.com
     
    Madhur Ahuja, Nov 3, 2004
    #3
  4. Andrew Thompson, Nov 4, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Saunders
    Replies:
    1
    Views:
    691
    John Saunders
    Nov 18, 2003
  2. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    921
    Mark Rae
    Dec 21, 2006
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,073
    Smokey Grindel
    Dec 2, 2006
  4. Replies:
    2
    Views:
    306
    Grant Wagner
    Dec 23, 2004
  5. dayo
    Replies:
    11
    Views:
    358
    Ilya Zakharevich
    Dec 16, 2005
Loading...

Share This Page