/**
   * Creates a new Panel according to the mimeType. It is called by the Plugin when NPP_SetWindow is
   * called.
   *
   * @param isBeans Is JavaBeans
   * @param k Array of param names.
   * @param v Array of param values.
   * @param instance Plugin instance.
   * @return New Java Plugin object.
   */
  public static MNetscapePluginObject createPluginObject(
      boolean isBeans, String[] k, String[] v, int instance) {
    MNetscapePluginObject p =
        new MNetscapePluginObject(instance, isBeans, LifeCycleManager.getIdentifier(k, v));

    // Put all elements in the parameter list
    for (int i = 0; i < k.length; i++) {
      if (k[i] != null && !PLUGIN_UNIQUE_ID.equals(k[i])) p.setParameter(k[i], v[i]);
    }

    /*
     * Set background/foreground and progress bar color for the applet viewer.
     * Do it here - after passing all HTML params to applet viewer.
     */
    p.setBoxColors();

    return p;
  }