I have put some JPanels into another JPanel which its\' layout is Box Layout and Y-Axis. After I have put all the panels I need to get the Y position of each added JPanel in
Suppose you have Jpanel father that contains a JPanel son. If cx is the coordinate x of the son with respect to the father and cy is the coordinate y of the son with respect to the father, then:
cx = son.getLocationOnScreen().getX()-father.getLocationOnScreen().getX()
cy = son.getLocationOnScreen().getY()-father.getLocationOnScreen().getY()
I think is the easiest way...