Java tutorial
//package com.java2s; import java.awt.Container; public class Main { public static int getContainerHeight(Container container) { int height = 0; for (int index = 0; index < container.getComponentCount(); index++) { int offset = (container.getComponent(index).getY() + container.getComponent(index).getHeight()); if (offset > height) { height = offset; } } return height; } }