简体   繁体   English

java japplet不接受输入

[英]java japplet not accepting input

I'm working on a java applet/desktop application. 我正在研究Java小程序/桌面应用程序。 It runs directly on the desktop, and should also run as a jApplet in a web browser. 它直接在桌面上运行,并且还应该在Web浏览器中作为jApplet运行。 I'm having some problems though that only occur when the program is running in a web browser. 我遇到了一些问题,尽管仅在程序在Web浏览器中运行时才会发生。 The first is I have some text box's in the application and for some reason they don't accept input. 首先是我在应用程序中有一些文本框,由于某种原因,他们不接受输入。 The second is when I press a button, the button kinda fires, but then doesn't actually call a method. 第二个是当我按下一个按钮时,该按钮会触发,但实际上并没有调用方法。 I'm not sure what is causing that. 我不确定是什么原因造成的。 http://24.111.117.77/skylabs/nolimits/index.php that's the link to the application so you can see what I mean. http://24.111.117.77/skylabs/nolimits/index.php是该应用程序的链接,因此您可以了解我的意思。 And also, when you press login, you should see that a socket connection was made, and a login attempt in the overhead console...but it doesn't show on the web app. 而且,当您按登录时,您应该看到建立了套接字连接,并在开销控制台中尝试了登录...但是它不会显示在Web应用程序上。 Theres quite a bit of code so if anyone has an idea by looking at it, that'd be great. 有很多代码,因此,如果有人通过查看有一个主意,那就太好了。 Thanks. 谢谢。

I'm using Swing...and also it doesn't work right as an applet, but it works perfectly as a standalone application. 我正在使用Swing ...,它也不能作为applet正常工作,但它可以作为独立应用程序很好地工作。

If you are using AWT give your text field a width. 如果您使用的是AWT,请为您的文本字段设置一个宽度。

TextField textField = new TextField("", 20);

also

setEnabled();

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

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