没有main方法,或是,不是可以用java来编译得。比如applet(用appletviewer0

解决方案 »

  1.   

    用appletviewer是什么,用什么工具编译?
      

  2.   

    appletviewer  是运行applet得。你的问题可以把代码铁出来,让大家帮你看看。
      

  3.   

    /**
       @version 1.30 2000-05-02
       @author Cay Horstmann
    */import javax.swing.*;
    import java.awt.*;public class NotHelloWorld
    {  
       public static void main(String[] args)
       {  
          NotHelloWorldFrame frame = new NotHelloWorldFrame();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.show();
       }
    }/**
       A frame that contains a message panel
    */
    class NotHelloWorldFrame extends JFrame
    {
       public NotHelloWorldFrame()
       {
          setTitle("NotHelloWorld");
          setSize(WIDTH, HEIGHT);      // add panel to frame      NotHelloWorldPanel panel = new NotHelloWorldPanel();
          Container contentPane = getContentPane();
          contentPane.add(panel);
       }   public static final int WIDTH = 300;
       public static final int HEIGHT = 200;  
    }/**
       A panel that displays a message. 
    */
    class NotHelloWorldPanel extends JPanel
    {  
       public void paintComponent(Graphics g)
       {  
          super.paintComponent(g);      g.drawString("Not a Hello, World program", 
             MESSAGE_X, MESSAGE_Y);
       }   public static final int MESSAGE_X = 75;
       public static final int MESSAGE_Y = 100;
    }
      

  4.   

    含main()的文件名字应起作NotHelloWorld