code: private void organize() {
          int m = (int) Math.sqrt(contentPane.getComponentCount());
          if (m <= 0) m = 1;
          contentPane.setLayout(new GridLayout(m, 0, 0, 0));
      }
docs: Reorganize the plots in the frame. Basically, it reset the surface layout
  based on the number of plots in the frame.