问题
I have created a Swing application in Netbeans that is basically a chat system (between multiple clients and server using socket programming).
Now I wanted to run this application on a webpage. Is this possible without changing any code?
回答1:
Now I wanted to run this application on a webpage. Is this possible without changing any code?
No. It would have to be a JApplet
to be embedded in a web page, and applets have been effectively killed off. See Java Plugin support deprecated and Moving to a Plugin-Free Web.
On the other hand, a desktop application (based on a JFrame
) can be launched from a link on a web page using Java Web Start.
Edit
Scrap that advice regarding JWS, apparently it too is being deprecated as of Java 9.
来源:https://stackoverflow.com/questions/42250660/how-to-run-a-swing-application-on-a-web-page