public void componentResized(ComponentEvent e) { Dimension dim = getSize(); dim.height -= 75; dim.width -= 50; graph.setDimensions(dim); }