Exemplo n.º 1
0
  public void addPanel(String caption, Component comp) {
    int pos = pages.size();
    NotebookPage np = new NotebookPage();
    np.setImageResolver(imgres);

    np.comp = comp;
    np.label = caption;
    np.hidden = false;
    np.poly = null;
    np.color = Color.gray;
    np.name = Integer.toString(pos);

    if (curIndex < 0) curIndex = pos;
    pages.addElement(np);

    oobj.add(np.name, np.comp);
    repaint();
  }
Exemplo n.º 2
0
 public void setVisible(int pos, boolean vis) {
   NotebookPage np = (NotebookPage) pages.elementAt(pos);
   np.hidden = !vis;
   layout();
   repaint();
 }