Imagine you have a JScrollPane
and many JLabel
s or any other JComponent
s added to it.
How would you check if a certain component is visible/partially visible/not visible to user? (scrolling)
I have tried to Google but could not find an easy solution. Is there some existing method I am missing or we have to deal with coordinates and rectangular comparison?
UPD: the following is not working in my case. It seem to relate to JLabel.setVisible(true/false) but not being inside JScrollPane
JLabel.isVisible();