简体   繁体   English

如何使用浏览器作为Java的GUI?

[英]How can I use a browser as gui for java?

I want something similar with php/jsp in java, but not on the server side, but on the client side. 我想要与Java中的php / jsp类似的东西,但不是在服务器端,而是在客户端。

Maybe I can make a html file with i/o, or with some net.* classes. 也许我可以用I / O或一些net。*类制作一个html文件。 But what can I use for the button on the html page ? 但是,我可以在html页面上使用什么按钮?

Thank you 谢谢

It sounds like you want something like the Google Web Toolkit . 听起来您想要类似Google Web Toolkit的东西。 You write your UI and logic in Java and it gets compiled into Javascript that then runs client-side in the browser. 您使用Java编写UI和逻辑,然后将其编译为Javascript,然后在浏览器中运行客户端。

Perhaps you mean you want to run an application on the local machine, but use an HTTP-based interface. 也许您的意思是您想在本地计算机上运行应用程序,但使用基于HTTP的界面。 In that case, you need the application to act as a web server on the local machine, then launch a web browser for " http://localhost:8080/ " (or whatever port the application is listening on). 在这种情况下,您需要该应用程序充当本地计算机上的Web服务器,然后启动用于“ http:// localhost:8080 / ”(或应用程序正在侦听的任何端口)的Web浏览器。

To implement this, you need an embedded web server such as Jetty . 要实现这一点,您需要一个嵌入式Web服务器,例如Jetty

install resin on your PC http://caucho.com/resin-4.0/admin/starting-resin.xtp (and JDK) 在PC上安装树脂http://caucho.com/resin-4.0/admin/starting-resin.xtp (和JDK)

can run jsp,html on http://localhost 可以在http:// localhost上运行jsp,html

问题有点含糊……也许像RhinoMozSwing这样的东西会有所帮助??

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

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