tags:

views:

564

answers:

3

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

+2  A: 

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.

David Zaslavsky
Microsoft's programs do tend to be embedable, (mspaint runs inside eclipse for instance) applets however can't do this sort of thing.
Tom
+1  A: 

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

Tom
+1  A: 

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.

TofuBeer