简体   繁体   中英

Java ssh (jsch) set stream to UI instead of console

I have a java program that uses the following lines to send ssh input/output to the console window.

channel.setInputStream(System.in);
channel.setOutputStream(System.out);

How might I acheive this using a UI instead of the console. For example, I have a UI with JTextPane panelOutput and JTextPane panelInput .

Same question as this person (unanswered): Java Redirecting Input and Output Stream of Terminal to GUI (JSch)

Also, Is there an existing open source java program that does this already?

This site has a java ssh UI download:

http://www.ganymed.ethz.ch/ssh2/

In the zip, it is the file: SwingShell.java

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM