Hi,
I am trying to use the Scanner class with Greenfoot using System.in, but I am unable to type anything into the Greenfoot console window. How do I solve this problem?
I would think the console window would be for output and not for input. You are probably capturing the keyboard input, but not dealing with it properly afterwards. That input must be programmatically processed and output to the console window as desired using 'System.out'.
The Console Window should support both output and input. Other Development environments such as jGrasp have console windows that support input. Does Greenfoot's not support input?
Input (as far as computers are concerned) is defined as any means by which external data is supplied to a program. This can be, for some examples, through reading of a disk file, input from the keyboard, or through a network link. If the console contains data, then some program supplied that data to it. Your keystrokes do not magically appear on the console and your program does acquire data from the console. It is NOT an input device. Maybe these other environments have underlying code that takes your keyboard input and displays (or outputs) it to the console. It would not be difficult to have the console behave that way during the execution of your program (obviously, if you are using the Scanner class, you are wanting that behavior during that time). Be aware, however, that the console window will not be available when uploaded on this site. Other means would have to be arranged to display keyboard input here.