For Programmers: Free Programming Magazines  


Home > Archive > Java Help > July 2004 > How to make a JFrame "dumb"...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to make a JFrame "dumb"...
Steffen Rueter

2004-07-28, 9:09 pm

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
jAnO!

2004-07-28, 9:09 pm

"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?


Steffen Rueter

2004-07-28, 9:09 pm

>>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
Real Gagnon

2004-07-28, 9:09 pm

> 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
Steffen Rueter

2004-07-28, 9:09 pm

Real 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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com