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(); }
public void setVisible(int pos, boolean vis) { NotebookPage np = (NotebookPage) pages.elementAt(pos); np.hidden = !vis; layout(); repaint(); }