Question

I wonder if it is possible to have a Java Class where you have a contructor like this:

public class SomeClass {
    JDialog dialog;

    public SomeClass(Window owner) {
        dialog = new JDialog(owner, "My Dialog", true);
    }

    public static void main(String[] args) {
        if(args.length == 1) {
            new SomeClass((Window) args[0]);
        }
    }
}

Is there a way how you could use that in a WPF application so that you could call something like System.Diagnostics.Process.Start("java -jar myprog.jar"); and use the WPF Window as parameter? Or is that even possible?

Was it helpful?

Solution

It is impossible. See can I make JDialog to be modal using native system window as a parent?.

If JDialog supported setting native window handles as owners, you could have passed HWND of WPF window as an integer parameter, but JDialog doesn't.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top