简体   繁体   中英

I can't run my applet in NetBeans

When I try to run my applet in NetBeans it tells me that there is no main class. I looked it up and others have had this error, but they don't give great instructions how to fix it. I tried going to Properties > Application > Web Start and changing it to Applet descriptor with my applet class. But, it still doesn't work, and I don't know why. can anyone help me out? Thanks!

Change the run configuration in the toolbar to Web Start:

在此处输入图片说明

Now when you click run, it will run the applet.

  1. Try putting in a main class that simply does nothing.

  2. If you have two different classes for this one applet, make sure you are running the one that has a main, only one needs one.

  3. As far as "selecting your applet as the main class" I don't have a clue what that means either.

Hope I've been helpful, I'm new to the whole graphics thing (for java, anyway) too!

If this problem persists, please elaborate!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM