🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Can't activate JButtons within an applet using the keyboard

#9804
From: Jeff Marendo
Date: Mon, 31 Jan 2000 00:00
66 lines
3160 bytes
Rich,

I had a practice project in JBuilder that had a class subclassed from
JApplet in it.  Originally, I was using the Windows L&F for that project.  I
threw a JButton in a panel with some functionality and it executed fine by
tabbing to it and hitting the enter key.  So, after I saw your reply about
the Metal L&F, I changed the code so that the Metal L&F would be used.  I
ran it again and was able to tab to the button, hit enter, and watch the
button's functionality go to work.

That's the desired behavior I want; but, in the other applet I'm working
(that's using Metal L&F) on, this desired functionality with using the
keyboard is not happening.  I have to click on a button with the mouse in
order for the button to do its thing.  I might have misunderstood what you
were saying before.  This applet that I'm talking about is running off of a
Unix box, so maybe things are happening a little differently between there
and this other practice project that I have in JBuilder3.

Jeff

rwilkman <rwilkman@inprise.com> wrote in message
news:3890C669.21F72562@inprise.com...
> Jeff:
>
> Are you trying to say that you switched back to Windows L&F and you
> still don't get the behaviour?  I had suggested you post over here a
> "how do I get Metal L&F to behave like Windows L&F" after we went
> through this in the applet group.
>
> -Rich
>
> Jeff Marendo wrote:
> >
> > Hello,
> >
> > I'm trying to figure out why the JButtons I'm using in my applet won't
> > execute their associated actionListener functionality when I hit either
> > 'Enter' key on my keyboard.  That is, all of the code in an
actionPerformed
> > event associated with a button's ActionListener will only be executed if
I
> > click on that button with the mouse.  I can tab to all of my button
> > components and see the tab moving, but when I stop on one and hit either
> > enter key on my keyboard, the button does not depress and nothing
happens.
> > Big bummer.
> >
> > Does anyone have an idea why this is happening?  Up until now, I've seen
the
> > functionality that I desire happen automatically with JButtons, so I'm
> > stumped.  Thanks in advance.
> >
> > Jeff
>
> --
> =====
> Rich Wilkman
> Senior Quality Assurance Engineer
> JBuilder Team
>
> If something in this post looks like an opinion, walks like an
> opinion and quacks like an opinion, it's mine and not that of
> my employer.
>
> If you are reading this from a newsgroup post, don't send mail.
> =====
Technical Details
Message-ID: <874nbb$2373@bornews.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <86q9cg$ria10@bornews.borland.com> <3890C669.21F72562@inprise.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,9877ed777dc9eea8
X-Google-Attributes: gid111d45,public
From: "Jeff Marendo" <marendoj@commos.com>
Subject: Re: Can't activate JButtons within an applet using the keyboard
Date: 2000/01/31
Message-ID: <874nbb$2373@bornews.borland.com>
X-Deja-AN: 580007854
References: <86q9cg$ria10@bornews.borland.com> <3890C669.21F72562@inprise.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
Organization: CommTech Corporation
X-MSMail-Priority: Normal
Reply-To: "Jeff Marendo" <marendoj@commos.com>
Newsgroups: borland.public.jbuilder.java.swing