Home > Back-end > Eclipse tip error: cannot find or unable to load the main class sun. The applet. AppletViewer
Eclipse tip error: cannot find or unable to load the main class sun. The applet. AppletViewer
Time:09-20
Just learning in Java GUI design, run the code found an error on the textbook, strives for the great god give directions! The code is as follows:
Package ilovejava; The import javax.mail. Swing. *; import java.awt.*; Public class t10_23 extends JApplet { The Container cp=getContentPane (); Public void init () { Cp. The add (new JButton (" NORTH "), BorderLayout. NORTH); Cp. The add (new JButton (" SOUTH "), BorderLayout. SOUTH); Cp. The add (new JButton (" WEST "), BorderLayout. WEST); Cp. The add (new JButton (" EAST "), BorderLayout. EAST); Cp. The add (new JButton (" CENTER "), BorderLayout. CENTER); } } Then the console prompt: Error: cannot find or unable to load the main class. Sun applet. AppletViewer Reason: Java. Lang. ClassNotFoundException: sun. Applet. AppletViewer
CodePudding user response:
CodePudding user response:
You whether JDK the environment is good, I use your code to run out of this