Getting Input From User
Koray
burakkoray at gmail.com
Sat Feb 25 17:41:51 UTC 2017
This is exactly what I'm looking for. Is it possible to do this from
inside a Java application? I have tried readLine() and readFully()
methods before, but I'm guessing they are meant for the commandline
tool only.
Burak
On 2/25/17, Jim Laskey (Oracle) <james.laskey at oracle.com> wrote:
>>> jjs -scripting
> jjs> var name = readLine("Your name >> ");
> Your name >> Jim
> jjs> print(name)
> Jim
>
> That sort of thing?
>
> — Jim
>
>
>> On Feb 25, 2017, at 5:24 AM, Koray <burakkoray at gmail.com> wrote:
>>
>> Hello,
>>
>> I apologize if this is not the place to ask, but I couldn't get a
>> satisfying answer from anywhere else so this is kind of my last
>> resort.
>>
>> Is there any built-in function to get input from a user when using
>> NashornScriptEngine? print() method allows us to utilize both the
>> default OutputStreamWriter (System.out) and any writers that we set
>> using ScriptContext, but how can I make use of the reader which is
>> used by the engine?
>>
>> Thank you,
>> Burak
>
>
--
saygılarımla
Burak Koray Polat
More information about the nashorn-dev
mailing list