🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #19923

Reading (or sensing) the keyboard.

#19923
From: Steve Young
Date: Wed, 26 Nov 1997 00:00
39 lines
1288 bytes

I am having an amazing amount of trouble sensing the keyboard.

After giving up on keyDown and keyUp changing a variable I stumbled onto
System.in.read() which while crude, would work for me.  However, the
best I can do is get the program to hang.

I have two "modules."  The compiler didn't mind a throw statement in the
first one:

> static public void main(String[] args)
>   throws java.io.IOException {


However, I couldn't make it happy in the second one which is where I am
using System.in.read():

> void buttonBar_actionPerfromed(ActionEvent e)
>   {

within:

> public class Frame1 extends DecoratedFrame
>   {


The code that doesn't work--even after pressing Return--is:

> try {
>       textIn = System.in.read();
>     }

> catch {
>         System.out.println("Darn!");
>       }


TIA for any hints.
Technical Details
Message-ID: <347c83e2.25745526@news.alt.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,de1f909feea493b7,start
X-Google-Attributes: gidf74b3,public
From: phantom@DELETE_THISsmartt.com (Steve Young)
Subject: Reading (or sensing) the keyboard.
Date: 1997/11/26
Message-ID: <347c83e2.25745526@news.alt.net>
X-Deja-AN: 292716875
Organization: Altopia Corp. - Usenet Access - http://www.altopia.com
Newsgroups: borland.public.jbuilder.java.language