コード例 #1
0
  /**
   * Sets the contents panel.
   *
   * @param c the contents panel
   * @exception NullPointerException if the java frame is null
   * @exception NullPointerException if the contents panel is null
   * @exception NullPointerException if the content pane is null
   */
  public void setContentsPanel(ContentsPanel c) throws NullPointerException {

    javax.swing.JFrame f = (javax.swing.JFrame) getJavaObject();

    if (f != null) {

      if (c != null) {

        java.awt.Container cp = f.getContentPane();

        if (cp != null) {

          cp.add((javax.swing.JPanel) c.getJavaObject(), java.awt.BorderLayout.CENTER);

        } else {

          throw new NullPointerException("Could not set contents panel. The content pane is null.");
        }

      } else {

        throw new NullPointerException("Could not set contents panel. The contents panel is null.");
      }

    } else {

      throw new NullPointerException("Could not set contents panel. The java frame is null.");
    }
  }
コード例 #2
0
  /**
   * Sets the status bar.
   *
   * @param s the status bar
   * @exception NullPointerException if the java frame is null
   * @exception NullPointerException if the status bar is null
   * @exception NullPointerException if the content pane is null
   */
  public void setStatusBar(StatusBar s) throws NullPointerException {

    javax.swing.JFrame f = (javax.swing.JFrame) getJavaObject();

    if (f != null) {

      if (s != null) {

        java.awt.Container cp = f.getContentPane();

        if (cp != null) {

          cp.add((javax.swing.JLabel) s.getJavaObject(), java.awt.BorderLayout.SOUTH);

        } else {

          throw new NullPointerException("Could not set status bar. The content pane is null.");
        }

      } else {

        throw new NullPointerException("Could not set status bar. The status bar is null.");
      }

    } else {

      throw new NullPointerException("Could not set status bar. The java frame is null.");
    }
  }
コード例 #3
0
  /**
   * Sets the tool bar.
   *
   * @param t the tool bar
   * @exception NullPointerException if the java frame is null
   * @exception NullPointerException if the tool bar is null
   * @exception NullPointerException if the content pane is null
   */
  public void setToolBar(ToolBar t) throws NullPointerException {

    javax.swing.JFrame f = (javax.swing.JFrame) getJavaObject();

    if (f != null) {

      if (t != null) {

        java.awt.Container cp = f.getContentPane();

        if (cp != null) {

          cp.add((javax.swing.JToolBar) t.getJavaObject(), java.awt.BorderLayout.NORTH);

        } else {

          throw new NullPointerException("Could not set tool bar. The content pane is null.");
        }

      } else {

        throw new NullPointerException("Could not set tool bar. The tool bar is null.");
      }

    } else {

      throw new NullPointerException("Could not set tool bar. The java frame is null.");
    }
  }