Article View: borland.public.jbuilder.java.swing
Article #9837Re: Consuming events
From: Paul Furbacher [TeamB]
Date: Fri, 07 Jan 2000 00:00
Date: Fri, 07 Jan 2000 00:00
35 lines
1858 bytes
1858 bytes
Dale Cooper wrote: First off, please do not post HTML-formatted messages. The guidelines specifically state that messages should use plain text only. AND, the guidelines discourage the practice of cross-posting. Post only to the most appropriate group. If you have posted to an inappropriate group, someone is very likely to let you know and suggest to which group you should direct your request for assistance. Thanks for adhering to the guidelines in the future. > I have kind of interesting problem. I have a combo > and under the combo are buttons. For a few buttons > I need to check CTRL state so that they consume the >click by mouseClicked event and not by actionPerformed. > And this is where the trouble is: > When I select an item from the combo the applet > serves BOTH events - the combo (actionPerformed) and the underlying > button event (mouseClicked). Try this: I would not listen for the mouseClicked event. Instead, I'd try listening for the mouseDown event and set a member variable with the state of the CTRL key. Then, when the actionPerformed event is handled, check the state. If member variable, "wasCTRLpressed" is true, simply return from the actionPerformed event handler. Paul Furbacher (TeamB)
Technical Details
Message-ID:
<3876B8A5.BE2CB39E@bilbo.bio.purdue.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<84rpn7$dto31@bornews.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,f4c26129c5e1f076 X-Google-Attributes: gid111d45,public From: "Paul Furbacher [TeamB]" <pf@bilbo.bio.purdue.edu> Subject: Re: Consuming events Date: 2000/01/07 Message-ID: <3876B8A5.BE2CB39E@bilbo.bio.purdue.edu> X-Deja-AN: 569844897 Content-Transfer-Encoding: 7bit References: <84rpn7$dto31@bornews.borland.com> Content-Type: text/plain; charset=us-ascii Organization: Reverse Alchemy, Inc. Mime-Version: 1.0 Reply-To: pf@bilbo.bio.purdue.edu Newsgroups: borland.public.jbuilder.java.swing