/**
   * closes the internal frame and removes any associated button and menu components
   *
   * @param f the internal frame being closed
   */
  public void closeFrame(JInternalFrame f) {

    super.closeFrame(f);

    // possible to retrieve the associated buttons right here via
    // f.getAssociatedButton(), and then with a call to getParent() the item
    // can be directly removed from its parent container, but I find the
    // below message propogation to DesktopPane a cleaner implementation...

    desktopPane.removeAssociatedComponents((BaseInternalFrame) f);
    desktopPane.resizeDesktop();
  }
  /**
   * maximizes the internal frame to the viewport bounds rather than the desktop bounds
   *
   * @param f the internal frame being maximized
   */
  public void maximizeFrame(JInternalFrame f) {

    Rectangle p = desktopPane.getScrollPaneRectangle();
    f.setNormalBounds(f.getBounds());
    setBoundsForFrame(f, p.x, p.y, p.width, p.height);
    try {
      f.setSelected(true);
    } catch (PropertyVetoException pve) {
      System.out.println(pve.getMessage());
    }

    removeIconFor(f);
  }