Pregunta

Sorry, but I am afraid!

I have mouse listener attached to my custom tab component. When I click on this tab I want to translate mouse Point to coordinates of parent JTabbedPane.

How to do this in swing?

Thanks friends!

¿Fue útil?

Solución

It appeares to be very easy to do.

Class javax.swing.SwingUtilities has a set of methods that convert Point and Rectangle from coordinate system of one component to another component.

It is also possible to convert MouseEvent.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top