What is Hierarchy for?

Well, I think it's for listening to hierarchy changes, but I don't quite understand what that really means.

Does anyone have a good example of real life when you need / can use it?

Thanks david

+3
source share
2 answers

I used it once.

I created a tooltip(tooltip, but with an arrow pointing to component component). I used JLayeredPane with POPUP_LAYER to implement it. Therefore, whenever the target component changed its position or changed its size, I needed a notification so that I could configure the tooltip arrow to point to it. This is my practical use of the HeirarchyListener . Now why could I use ComponentListener;)?

+3
source
+3

Source: https://habr.com/ru/post/1794400/


All Articles