Have you ever stumbled upon the situation that you wanted to deliver MouseEvents to parts of your SWING application? I ran into the situation, that I needed to deliver a MouseEvent to a JComponent that is included within a JGraph application. If this all sounds a bit confusing to you, don't read on...
...you're still here, most likely because you ran into a similar problem while doing something with JGraph - alright, I'll annoy you with the gory details then.
The problem:

You see an application that uses JGraph to visualize a graph structure. Everything is fine until your vertices contain Components that are supposed to react to (Mouse)Events, because JGraph consumes them - which is a good thing. You don't have to implement anything in order to enable the user to drag vertices around and do all kinds of fancy stuff to them.
On the other hand, you might want to have more complex vertices in your graph, as in the example above. Creating your own CellView and CellRenderer won't do the job. Well, it'll do half the job. JGraph makes use of the Flyweight pattern to increase performance. In short, this means that the components that are used to visualize vertices are not really "there" - it's just the same component drawn over and over again at different places with different values.
So the first thing to do is make sure your vertices are no flyweights (meaning a static CellRenderer) but that each vertice has it's own instance. Say you decide to use a JScrollpane in your vertice because the Cells are in danger of running out of space. You will notice that clicking and dragging the scrollbars does not work: JGraph intercepts your MouseEvents and you'll select and drag the vertice instead of scrolling it. The second thing to do is what took me a while to implement.
The solution:
The first thing I tried to do is extend JGraph's BasicGraphUI and it's embedded MouseHandler class. I then interceped clicks to the scrollpane while leaving clicks to the rest of the cell alone (I still want the user to be able to select cells and drag them around). At that point I thought: That was easy, I'm done.
Not knowing so much about SWING, I decided to just "forward" the MouseEvent to the JScrollPane using it's dispatchEvent() method hoping it would pass the Event on to all contained Components, and, guess what, it didn't work. dispatchEvent() dispatches the passed event to all registered MouseListeners of the Component and calls it's own processEvent() method, if I remember correctly.
However, the JScrollpane didn't have any MouseListeners registered - and nothing happened. I expected JScrollpane to "deliver" the clicks to it's scrollbars which, in fact, it didn't. So I had to translate the coordinates of the MouseEvent to those of the scrollbars and deliver the event directly to them.
Most likely this is the least elegant solution, but finally it works.
