UE4 area inside an application window

I’m trying to render things with UE within a Java application (a toolset based on Eclipse, but doesn’t matter).

Java itself obviously doesn’t allow to do that, but I can hack inside UI frameworks (AWT, Swing, SWT etc) and capture native rendering surfaces. We did it for different things like an embedded browser.

But what should I do next? How can I run UE in the background and then render to a region of a native window (?) and pass-through user input?

I googled and found mentions of custom usage of FViewport, but not sure how to do it. Maybe someone has a small example?

Another big different story is how to use it in a platform-independent way. Maybe we should leave iOS and Android alone, but Windows, GNU/Linux, and Macs are somewhat important for a desktop app (a big legacy toolset for game designers, that I want to port from custom GL engine to something less rusty).

Thanks, and may the Force be with you