🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #604

Re: Keyboard Input?

#604
From: John McGrath [TeamB]
Date: Wed, 16 Mar 2005 22:00
24 lines
1783 bytes
On 3/16/2005 at 4:22:12 AM, Vander wrote:

> Perhaps a bit off the swing topic, but I wonder if it is possible to
> obtain direct keyboard character/signal input from the console.
> System.in only reads lines of text and echoes all characters. For a
> commandline utility I need to perform password input, so to echo only
> "*" instead of the text. - Can somebody know a solution or can give me
> directions? Thanks!

There is nothing in Java that allows this level of control over console
input.  To do this with console input, you would need to use some sort of
native library.  An alternative approach would be to use a GUI console
window, such as the JConsole class that comes with BeanShell:

   http://www.beanshell.org/

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <xn0dztrm97vxxax007@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4237faa1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,4ed6eade21edc20e
X-Google-Attributes: gid111d45,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "John McGrath  [TeamB]" <ng-b@JPMcGrath.net>
Subject: Re: Keyboard Input?
Newsgroups: borland.public.jbuilder.java.swing
References: <4237faa1@newsgroups.borland.com>
User-Agent: XanaNews/1.17.2.7
Message-ID: <xn0dztrm97vxxax007@newsgroups.borland.com>
X-Ref: newsgroups.borland.com ~XNS:0000029B
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
NNTP-Posting-Host: 151.201.155.159
Date: 16 Mar 2005 14:00:32 -0800
X-Trace: newsgroups.borland.com 1111010432 151.201.155.159 (16 Mar 2005 14:00:32 -0800)
Lines: 24
X-Authenticated-User: jpmcgrath
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail