Tutorial :how embed windows program into java applet?



Question:

how i embed a running windows program into java applet, like notepad, mspaint,...


Solution:1

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.


Solution:2

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.


Solution:3

You can't, applets are sandboxed an you won't be able to call out to anything as external as other programs.


Solution:4

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.)


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »