![]() Home | ![]() Back | ![]() Contents | ![]() Next |
The bsh.util.JConsole is a light weight graphical shell console window,
with simple command editing and history capabilities. BeanShell uses
the JConsole for the GUI desktop mode again in the JRemoteApplet
for the remote server mode.
You can use the JConsole to provide an interactive BeanShell prompt in
your own applications.
You are free to use the JConsole for your own purposes outside of BeanShell
as well! It is a fairly generic shell window easily attached to any kind of
streams or through the simple console interface.
JConsole is a Swing component. Embed it in your application as you would
any other swing component. For example:
JConsole console = new JConsole(); myPanel.add(console); |
Interpreter interpreter = new Interpreter( console ); new Thread( interpreter ).start(); // start a thread to call the run() method |
| Tip: When interacting with any Swing component from outside the Java event handling thread, use the Swing thread safety facilities: SwingUtilities.invokeNow() and invokeLater(). |
| Reader getIn(); |
| PrintStream getOut(); |
| PrintStream getErr(); |
| void println( String s ); |
| void print( String s ); |
| void error( String s ); |
![]() Home | ![]() Back | ![]() Contents | ![]() Next |