com.soundhelix.remotecontrol
Class SwingRemoteControl
java.lang.Object
com.soundhelix.remotecontrol.AbstractTextRemoteControl
com.soundhelix.remotecontrol.SwingRemoteControl
- All Implemented Interfaces:
- RemoteControl, TextRemoteControl, Runnable
public class SwingRemoteControl
- extends AbstractTextRemoteControl
Implements a remote control bases on Swing.
- Author:
- Thomas Schuerger (thomas@schuerger.com)
|
Method Summary |
String |
readLine()
Returns the next line entered by the user. |
void |
writeLine(String line)
Writes a line to the output that is to made visible to the user. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SwingRemoteControl
public SwingRemoteControl(JTextField inputTextField,
JTextArea outputTextArea)
- Constructor.
- Parameters:
inputTextField - the input text fieldoutputTextArea - the output text field
readLine
public String readLine()
- Description copied from interface:
TextRemoteControl
- Returns the next line entered by the user. This method is allowed to block until input is available, or it can return null if there is no
input. The returned string must contain the net line content only (without any line separator(s) at the end).
- Returns:
- the user input string or null if none is available
writeLine
public void writeLine(String line)
- Description copied from interface:
TextRemoteControl
- Writes a line to the output that is to made visible to the user. The string should not contain CR or CR and LF at the end.
- Parameters:
line - the string to write