我正在尝试在JFrame上添加一个Applet对象,但它不可见。
有谁知道这是什么原因?
我的JFrame构造函数:
TestApplet apl;
public RunnerMain()
{
setTitle("File Generator");
setSize(800, 1000);
setResizable(false);
apl = new RunnerGUI();
Container cp = getContentPane();
cp.setLayout(new FlowLayout());
cp.add(apl);
}
我的applet定义:
public class TestApplet extends Applet implements MouseListener, MouseMotionListener
{
public void init()
{
...
buffer = createImage(800, 800);
doublebuffer = buffer.getGraphics();
...
}
}