// ============================================================================
// File:               $File$
//
// Project:            
//
// Purpose:            
//
// Author:             Rammi
//
// Copyright Notice:   (c) 2008  Rammi (rammi@caff.de)
//                     This code is in the public domain.
//                     Use at own risk.
//                     No guarantees given.
//
// Latest change:      $Date$
//
// History:	       $Log$
//=============================================================================
package de.caff.asteroid.analysis;

import javax.swing.*;

/**
 *  Reproduce strange error.
 */
public class TestApplet
        extends JApplet
{
  private JLabel label;

  @Override
  public void init()
  {
    System.out.println("init()");
    label = new JLabel("State 1");
    getContentPane().add(label);
  }

  @Override
  public void destroy()
  {
    System.out.println("destroy()");
  }

  @Override
  public void start()
  {
    System.out.println("start()");
  }

  @Override
  public void stop()
  {
    System.out.println("stop()");
  }

  // call via LiveConnect
  public void startThread()
  {
    new Thread(new Runnable() {
      public void run()
      {
        try {
          Thread.sleep(100000L);
        } catch (InterruptedException e) {
          e.printStackTrace();
        }
        label.setText("State 2");
      }
    }).start();
  }
}
