final ArrayList<Integer> widths = new ArrayList<Integer>();
SwingUtilities.invokeAndWait( new Runnable() {
public void run() {
frame.validate();
ComponentTraverser.traverse(frame, new ComponentProcedure() {
@Override
public void run(Component c) {
if (c instanceof XYPlot) {
widths.add(((XYPlot) c).getYAxis().getWidth());
widths.add(((XYPlot) c).getXAxis().getStartMargin());