-1

is it possible to add an instance of a java application as a child form a .NET Form?

Thanks

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Mark Hähnel
  • 175
  • 1
  • 13
  • This is a very strange thing to want. What's the motivation here? Why does the Java application have to be a child of a .NET application? Why can't you just run two applications? – Cody Gray - on strike Feb 19 '12 at 09:39

2 Answers2

0

I don't think it is. A Java program will have to run in its own process. A window from one process cannot be the child of a window of another process.

EDIT: Apparently I was wrong, it is possible to have a window from one process be a child of a window from another process, for example here

It might work with Java, depending on how the Java GUI framework the application uses works with Windows controls. The Windows Spy can help you figure out a little more about your Java application.

Community
  • 1
  • 1
zmbq
  • 38,013
  • 14
  • 101
  • 171
  • I've seen some tutorials about the windows calculator as child window of a .net form. But that doens't work with a java window. :/ – Mark Hähnel Feb 19 '12 at 09:29
0

There is no easy and straightforward way todo that, at least that I'm aware of. One of possible solutions could be to make from your Java application an Applet and recall it inside embedded in Windows Form WebBrowser control. After you need to care about communication between your application and applet.

Some hints can find here

Hope this helps.

Tigran
  • 61,654
  • 8
  • 86
  • 123
  • Thats not possible because the Java application is not written by me. So i have no chance to put it into an applet. But the Application is a Command Line windows, so is it possible to get the output? Like you can do it with a standard command line application? Thanks – Mark Hähnel Feb 19 '12 at 09:51
  • If the application written in `Java` produces some *expected* output and you can manipulate it in reasonable way for *your* application, it's the way to go. Do not embed anything, but run that `Java` app like a separate exe. An example how to read can find [here](http://www.dotnetperls.com/redirectstandardoutput) – Tigran Feb 19 '12 at 10:13