Hi Pavel,
Some answers below.
On 2/4/24 22:36, PavelTurk wrote:
Hello all.
Could anyone explain how it is possible to run native application, for
example, midnight commander in NB terminal?
NetBeans uses a pure-Java terminal emulator. This is spread in different
modules, the low-level module with support for terminal emulation is the
"ide/lib.terminalemulator" module. Here's a pointer to get you started:
https://github.com/apache/netbeans/blob/905ff7ef8344e372318751f6e93082a35da3b87f/ide/lib.terminalemulator/src/org/netbeans/lib/terminalemulator/Term.java
I mean NB is a java application and as I understand it uses swing
library for UI. And how was native application made
to work inside java application with swing? What is the magic here?
As explained by Thomas Wolf, you can launch any operating system process
(say midnight commander) using the Java's ProcessBuilder class (NetBeans
also has ad-hoc process launching mechanisms that were in place before
ProcessBuilder was invented, see [1]).
Once you launch an external process the modules
"ide/lib.terminalemulator", "ide.terminalnb", "ide/dlight.terminal" and
some others are responsible for painting the terminal emulator in Swing.
Hope this helps,
Antonio
[1]
https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-extexecution-base/overview-summary.html
Best regards, Pavel
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists