Article View: borland.public.jbuilder.java.api
Article #3169Re: Event Handling
From: Dean Henkel
Date: Thu, 09 Apr 1998 00:00
Date: Thu, 09 Apr 1998 00:00
40 lines
1907 bytes
1907 bytes
No need to reply I have figured out my problem. Dean Henkel wrote: > I've got a question regarding Event Handling, specifically catching > mouse events. > > My application usesSwing Controls. I've got a JFrame, which contains a > JPanel, which Contains a JSplitFrame, which contains some controls in > each pane. > > JFrame > JPanel > JSplitFrame > JButton > JTextField > > What I would like to do is have the JPanel catch a mouse move event when > the mouse moves any place over the pane, (which would be over the > JButton or the JTextField since they take up the entire panel). I've > implemented the processMouseMotion() method in the JPanel class. > Unfortunately the method never gets called. I added the > processMouseMotion() to the JSplitFrame() class, and it gets called when > the mouse cursor is over the slider portion of the window but not over > any of the controls within the split panes. > > I assume the control's(JButton, JTextField) are eating the mouse events > and they never get passed to container classes. > > What is the procedure for passing events to container classes. Must the > containers have a processMouseMotion() and call the containers > processMouseMotion() assuming the component has a handle to the > container? Examples would be helpful. > > Thanks. > > Dean
Technical Details
Message-ID:
<352D350F.A7745685@us.ibm.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<352D293D.8910A9E3@us.ibm.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,1ba7feb2c73626b1 X-Google-Attributes: gid1089d0,public From: Dean Henkel <henkel@us.ibm.com> Subject: Re: Event Handling Date: 1998/04/09 Message-ID: <352D350F.A7745685@us.ibm.com> X-Deja-AN: 342523754 Content-Transfer-Encoding: 7bit References: <352D293D.8910A9E3@us.ibm.com> Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.api