Code Comments
Programming Forum and web based access to our favorite programming groups.I am not really proficient in Java, so please excuse if this question is trivial: I got an application which consists of several JPanels next to each other. One of the JPanels has (within its code) some actions defined for mouse activity within that frame. What I need: I want to use a "normal" mouse listener on top of that special JPanel. BUT: the in-built functionalities override my mouse listener. So: is there a way to make the "active" panel go dumb (as in: not to interfere with mouse action) WITHOUT editing this panel's source code? Like putting an invisible layer on top or the like? I do need the data this panel displays, but I must not edit the source code... Any ideas, hints? Thank you Steffen
Post Follow-up to this message"Steffen Rueter" <usenet@familie-rueter.de> wrote in message news:ce83vq$4mm$1@post.student.mu-luebeck.de... > I am not really proficient in Java, so please excuse if this question is > trivial: > > I got an application which consists of several JPanels next to each > other. One of the JPanels has (within its code) some actions defined for > mouse activity within that frame. > > What I need: I want to use a "normal" mouse listener on top of that > special JPanel. BUT: the in-built functionalities override my mouse > listener. > > So: is there a way to make the "active" panel go dumb (as in: not to > interfere with mouse action) WITHOUT editing this panel's source code? > Like putting an invisible layer on top or the like? > > I do need the data this panel displays, but I must not edit the source > code... > > Any ideas, hints? Thank you > Can't you just extend the JPanel and override anything you don't want?
Post Follow-up to this message>>So: is there a way to make the "active" panel go dumb (as in: not to > > Can't you just extend the JPanel and override anything you don't want? Depends - that's the way I'd prefer not to go. The class in question has about 25 methods calling several subclasses and so on, and I do NOT have the time to follow each trail to see where it leeds and where any action listeners are implemented... btw, I just looked at the source code and commented out anything that had actionlistener in it, the display still works fine, but still no mouse listener for me :-( Thanks anyway Steffen
Post Follow-up to this message> So: is there a way to make the "active" panel go dumb (as in: not to > interfere with mouse action) WITHOUT editing this panel's source code? > Like putting an invisible layer on top or the like? If your are using Swing, then the "glass pane" may be useful : http://java.sun.com/docs/books/tuto...s/rootpane.html Bye. -- Real Gagnon from Quebec, Canada * Looking for Java or PB snippets ? Visit Real's How-to * http://www.rgagnon.com/howto.html
Post Follow-up to this messageReal Gagnon wrote: > > > If your are using Swing, then the "glass pane" may be useful : > > http://java.sun.com/docs/books/tuto...s/rootpane.html I've been experimenting with this, but so far without success. I do have the impression that the "active" panel somehow steals all inputs, although each and every line in there that refers to action listeners and the like has been commented out... Steffen
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.