I have done a little research online with no luck, and I cant seem to see a question on SO similar to this.
I wanted to know if its possible to place a windows program to fit inside a jFrame or jWindow. The particular example I had in mind was if I were to create a jFrame, can I spawn a windows program to open (i.e. cmd.exe) and embed that window within my jFrame somewhere. Hopefully the following image depicts what Im trying to acheive.
<img alt="enter image description here" class="b-lazy" data-src="https://i.stack.imgur.com/uWopn.jpg" data-original="https://i.stack.imgur.com/uWopn.jpg" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" />Answer1:
This has been asked before several times on this site, and always, as far as I can recall the answer is the same: while yes this is theoretically feasible, it is extraordinarily difficult to implement, especially since Java Swing uses light weight components that are not created by the OS, but created by the Swing itself. You would be better off using a language that allows you to get tighter with the operating system such as C# if Windows or C/C++ with Windows and most everything else.
So my final answer: this is not practical with Java Swing GUI's.<hr />
<strong>Edit</strong><br /> Note that if all you want to do is to stream output from the command line, this can be done by displaying it in a JTextField or JEditPane or JTextPane. There is no need to embed an OS window into the GUI for this.