문제

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!

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top