[vtkusers] Swing Based vtkPanel

Satheesh Maheswaran s.maheswaran at eastman.ucl.ac.uk
Tue Mar 5 10:23:22 EST 2002


hello users

I am trying to get vtkPanel.java work with SimpleVTK.java given with VTK. Its in
vtk/wrapping/java

All works, and the panel gets displayed with cone and an exit button.  Here awt and swing
components are mixed, and the vtkPanel.java extends Canvas, which I think is awt.

So when i run it and try to interact with it, all key events work and the exit button work,
but when trying the mouse events. like zooming, it crashes :)

has anyone come across the same problem !!! or may be even a solution for the problem !!

satheesh

"Gopalakrishnan, Gowri" wrote:

> If you look in the sun's web site on JNI (java native interface) and the
> native code for vtkPanel.java you will see that they are quite identical.
> It used to be that you could grab drawing surface information and the window
> handle only from canvas (it is a undocumented codes in jdk). But I have come
> across something similar in Swing. In vtk 3.2 it is done using canvas, but
> in vtk4.0 I do not know. You cannot use anything else other than canvas (now
> a swing component - I forgot which )to get this information from sun's jdk.
>
> Also with your swing problem - even if you got it to work now you might end
> up with strange behaviours in swing components when they are put on the awt
> component. Event handling especially can be troublesome. If you have not
> done too much dev. already it is a good/wise idea to change to completely
> swing. Mixing awt and swing leads to frustration.
>
> Gowri
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers




More information about the vtkusers mailing list