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
Coordinates are relative to their parent. In your exemple, all the child components are being added along the top of the parent container, making there y position 0 (relative to their parent).
Try adding an empty border to the parent container, you should see the y position change.
You can use the SwingUtilities.convertPoint to convert between coordinate systems