简体   繁体   中英

how embed windows program into java applet?

我如何将正在运行的Windows程序嵌入Java小程序中,例如记事本,MSpaint,...

I don't think you can. One of the basic principles of Java is security, and if you were able to embed an innocuous Windows program like Notepad, what's to stop someone else from embedding some kind of a virus in the applet?

Not to mention, standalone programs aren't really embeddable in anything. You'd need to have some kind of embeddable widget - that exists for, say, Excel (that's how you can get spreadsheet boxes in MS Word documents) but not for every program out there.

You might be able to do something with a signed applet... but you are not going to be able to get the app to display on a remote machine.

If you just want it for local use you could probably convince an applet to launch notepad (I haven't ever thought of doing something like that, but if the applet is signed it is out of the sandbox so I cannot see why you could not), but it will launch on a new window on the local machine.

You could look at JACOB for Java-COM integration which might maybe do what you want, again if it is only on the local machine. You would still need a signed applet.

Maybe it could be done with:

  1. The real Windows program, running on a real Windows box with a VNC server
  2. The applet version of the TightVNC client

Obviously this would be best suited to running on a corporate intranet (the OP does not specify where it will be used.)

您不能,小程序被沙盒化,您将无法像其他程序一样调用任何外部程序。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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