import java.applet.Applet;
import javax.swing.*;
import java.awt.*;/**
*
* @author Administrator
*/
public class Applet1 extends Applet
{ /**
* Initialization method that will be called after the applet is loaded
* into the browser.
*/
public void init()
{
// TODO start asynchronous download of heavy resources
getContentPane().add(new JLabel("Applet"));//不能通过编译
} // TODO overwrite start(), stop() and destroy() methods
}
原文如上,不能通过部分已经注明
import javax.swing.*;
import java.awt.*;/**
*
* @author Administrator
*/
public class Applet1 extends Applet
{ /**
* Initialization method that will be called after the applet is loaded
* into the browser.
*/
public void init()
{
// TODO start asynchronous download of heavy resources
getContentPane().add(new JLabel("Applet"));//不能通过编译
} // TODO overwrite start(), stop() and destroy() methods
}
原文如上,不能通过部分已经注明
把Applet改称JApplet
Applet中没有getContentPane()方法