why this Applet fails

M

Madhur Ahuja

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();
}

}
 
A

Andrew Thompson

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

What browser? What Java?
...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?
 
M

Madhur Ahuja

Andrew Thompson said:
What browser? What Java?


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 !
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top