>   I've written some code to make a JTable with one of the columns of
> JmolPanel type (based of the code in Integeration.java). Currently the
> code is able to display a set of molecules in the rows of the JTable.

Good.

> However I cant use the mouse to rotate them. I realize that the JTable
> does not automatically forward events to the individual components.

Hmmm ...

> Thus I was trying to see which addXXXListener() function would be
> applicable to the JTable so that in the listener function I could check
> that the cell was a JmolPanel type and dispatch the event to
> handleEvent() in the JmolViewer.
>
> The problem I'm facing is that the handleEvent() function in JmolViewer
> takes and Event object while a listener function such as MouseListener
> supplies me with a MouseEvent - which I cant seem to coerce to the Event
> type.

It has been some time since I looked at this code. So we will need to work
on this together.

Do not be confused by the routine JmolViewer.handleEvent(). I believe that
code is only for old JVMs.

Since you are running under Swing, you need to look for other things.

We may need to add a few routines to help you out.

First, try this ...

You want to send the events to the java.awt.Component that is holding the
instances of the JmolViewer.

MouseManager11.java registers itself with the Component so that it will
pick up the events.

I have not done that much Swing programming, but it seems to me that if
you can just send your MouseEvents to the Component, then it will dispatch
the events correctly.



> My main question - is this the correct way to handle events in this
> situation (ie catch events and dispatch them handleEvent())?

No ... only under old Java JVMs ... I probably should change the method
name so that this is more clear.


Miguel




-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Jmol-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to