Hi All

I am trying to change my System.in InputStream to instead take values from the terminal window but take values from a JEditorPane or JTextBox.

I have this to add the text to the new InputStream which has been declared.
GUI Class:
public static InputStream consoleInputStream;
sendButton.addActionListener(new ActionListener() {
	public void actionPerformed(ActionEvent e) {
		String message = sendPane.getText();
		consoleInputStream = new ByteArrayInputStream(message.getBytes());
I then want to use this in another class to output the text:
public static String readLine() {
	String s = null;
	BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	try {
		s = in.readLine();
	} catch (IOException e) {
	return s;
But I get java.lang.NullPointerException at java.io.Reader. (Unknown Source) at java.io.InputStreamReader. (Unknown Source).

What I have is a CLI applciation that runs off the User inputs from the terminal within Eclipse all I want to do is change main System.in input Stream to a Jtextbox output. I have the above working just in CLI (of course not setting System.setIn()...)

Any pointers would be awsome!