import java.awt.*;
import java.awt.event.*;
public class threadtest3  extends  Frame//implements  
{   
   public static void main(String[] args)
   {
Frame f=new Frame();
f.addWindowListener(new QuitWindow());
f.resize(300,300);
f.setBackground(Color.cyan);
f.show();
threadt t=new threadt();
t.start();
while(true)
{
System.out.println("test33333333333");
}
   }
   
   public boolean handleEvent(Event evt)
{
if(evt.id==Event.WINDOW_DESTROY)
{

System.exit(0);
}
return super.handleEvent(evt);

} }
class threadt extends Thread
{


public void run()
{
while(true)
{
System.out.println("this is in thread run");
}


}
}
class QuitWindow extends WindowAdapter
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
}