/**
   * 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);
  }
  public ScriptParamsForm(JInternalFrame pParent, ErrorHandler pErrorHandler) {
    errorHandler = pErrorHandler;
    dialog = new ScriptParamsDialog();
    Rectangle parentBounds = pParent.getBounds();

    int dialogWidth = 500;
    int dialogHeight = 400;
    int x = parentBounds.x + (parentBounds.width - dialogWidth) / 2;
    int y = parentBounds.y + (parentBounds.height - dialogHeight) / 2;

    dialog.setBounds(x, y, dialogWidth, dialogHeight);

    dialog
        .getRunScriptButton()
        .addActionListener(
            new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                runScript();
              }
            });
  }