<p>Scanner can only get input from system console? not be able to get from any dialog window?</p>

<p>Thanks.</p>

A
Scanner
can read text from any object which implements the
Readable
interface.
That includes
```
BufferedReader
```
,
```
CharArrayReader
```
,
```
CharBuffer
```
,
```
FileReader
```
,
```
FilterReader
```
,
```
InputStreamReader
```
,
```
LineNumberReader
```
,
```
PipedReader
```
,
```
PushbackReader
```
, and
```
StringReader
```
(from the
```
Readable
```
javadoc).  Unfortunately, that does not include any dialog windows.
The easiest way to hook a dialog window to a
```
Scanner
```
would probably be to build a
```
Scanner
```
using the constructor that takes a
```
String
```
, passing the user input from the dialog directly to the
```
Scanner
```
.