简体   繁体   English

如何在Eclipse中使用Applet getParamter

[英]How to use Applet getParamter in Eclipse

I have a simple Java Applet (SE 7) with an HTML file containing Applet and Param elements. 我有一个简单的Java Applet(SE 7),带有一个包含Applet和Param元素的HTML文件。

GetParameter() works fine hitting the HTML page with a browser or using appletviewer, but when I run the app in Eclipse (Juno Build id: 20130225-0426) the debugger shows GetParamter() returns null for every call. 使用浏览器或使用appletviewer,GetParameter()可以很好地访问HTML页面,但是当我在Eclipse中运行应用程序(Juno Build ID:20130225-0426)时,调试器显示GetParamter()每次调用均返回null。

The class and html files are in the bin directory of the project. 类和html文件位于项目的bin目录中。 Should this just work or is there some configuration I need to make when setting this up or launching in Eclipse. 应该这样做还是在Eclipse中进行设置或启动时需要进行一些配置。

Thanks in advance for your help. 在此先感谢您的帮助。

Well I've found one approach that seems to work (from the Eclipse site). 好吧,我发现了一种似乎可行的方法(来自Eclipse站点)。

Select the Applet -> run configurations -Parameters and manually enter the parameter names and values. 选择Applet->运行配置-Parameters并手动输入参数名称和值。

It works but this doesn't appear to exercise the getParameter() HTML interaction using Eclipse. 它可以工作,但这似乎无法使用Eclipse进行getParameter()HTML交互。 SO I'm back to appletviewer to ensure my HTML works properly with my Java class from what I can tell. 所以我要回到appletviewer,以确保我的HTML可以正确地与Java类一起使用。

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

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