简体   繁体   English

我无法在NetBeans中运行小程序

[英]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. 当我尝试在NetBeans中运行小程序时,它告诉我没有主类。 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. 我尝试转到“属性”>“应用程序”>“ Web Start”,并使用我的applet类将其更改为Applet描述符。 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: 将工具栏中的运行配置更改为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! 如果问题仍然存在,请详细说明!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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