Hey
I am currently using the terminal to enter commands into my "game"
using
reader = new Scanner(System.in);
String inputLine = reader.nextLine();
This works fine, but I now have an interface which I would like to be
able to use instead of the terminal. I have a JTextField which is where
users will type in commands.
Any way to utilise the scanner with a JTextArea?
Tom Hawtin - 07 Jan 2007 17:43 GMT
> Any way to utilise the scanner with a JTextArea?
new Scanner(field.getText())
Although, obviously the UI is going to suck if the text area is
unconstrained yet requires a particular format.
Tom Hawtin