Create a 'BufferedReader' out of a JTextField
I'm fairly new to Java, and I need to create a 'BufferedReader' for a
JTextField. What needs to happen is, when the program calls my getText()
method, It needs to wait until it recieves input from the Enter key event
handler. If i do something like:
String input = null;
while(true) {
if(!input.equals(null)) {
break;
}
}
I get nullpointerexception errors. I've thought about it, and determined
that since getText() has to return data to the method that called it, I
would have to run like a nested method inside the getText() method, that
would be able to run the code to run the data. Any ideas?
No comments:
Post a Comment