如何将一个application转化为applet  ,application已经继承了一个类了,如下:
public class BinsearchFrame extends AnimationFrame
    implements ActionListener()
{
  ...........//省略内容
}public abstract class AnimationFrame extends JFrame
    implements ActionListener()
{
...............//省略内容
}程序运行的时候都是在一个窗口上运行,我想把这个BinsearchFrame改写成applet 放在网页中播放,请问如何改写,谢谢!急!

解决方案 »

  1.   

    很简单, 用组合模式,将BinsearchFrame 作为JAPPLET的一个JPanel放置在APPLET上即可,
    其他操作完全和普通applet一样
      

  2.   

    public class myapplet extends Applet
    {
      public void init()
      {
        BinsearchFrame bf=new BinsearchFrame();
        this.add(bf)
      }
    }
      

  3.   

    其实都是差不多的,
    Applet在一个容器中运行,注意Applet的相应生命周期的方法就行了
      

  4.   

    各位说的 小弟不才 无法弄懂 
    我试了 ,只能是点击后myapplet启动后调用BinsearchFrame运行 
    我想达到的结果是 打开一个网页后,BinsearchFrame不是以一个框架的形式弹出运行,想让他在网页中想applet一样播放