按照书上的抄了applet程序进去,怎么调试啊
- Java code
import java.applet.*;import java.awt.*;import javax.swing.*; public class AppletLife extends Applet{ int count; public void init() { JOptionPane.showMessageDialog(null, "hello, init Method invoked!"); } public void start() { JOptionPane.showMessageDialog(null, "Welcome back, stop method invoked!"); } public void destroy() { JOptionPane.showMessageDialog(null, "Goodbye, destroy method invoked!"); } public void paint(Graphics g) { g.drawString("这是第" +(++count)+ "次调用paint()方法", 30, 30); }}
------解决方案--------------------------------------------------------
右键上下文菜单有Applet运行模式的吧,平时用的Application模式~