Adding JFrame to JApplet
问题 Can I add program based on JFrame to JApplet ? How can I do that, when I try to do it like: public class Test extends JApplet{ public void init(){ JFrame frame=new JFrame(300,400); add(frame); frame.setVisible(true); } I got an error when i try to use appletviewer. Can anyone help me ? 回答1: You can't add a frame to an applet, but you can add an applet to a frame: import javax.swing.*; import javax.swing.event.*; import java.awt.*; import java.awt.event.*; public class AppletBasic extends