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

CodePudding user response:

refer to the second floor Timor__ response:
you whether JDK the environment is good, I use all of your code to run out the

May be... At that time is according to the configuration of a post online tutorial, can you help me take a look at how to match

CodePudding user response:

I see what do you configure the next first, otherwise I also don't know what we have is not the same

CodePudding user response:

We two qq chat qq, 1072979963

CodePudding user response:

GUI don't too deep under a brief study of the in-depth study
is not recommendedBecause Java is too litter

CodePudding user response:

The building Lord find less configuration? I also met the same problem

CodePudding user response:

Your main method?
Public static void main (String [] args) {

}
  • Related