Package javax.swing

Examples of javax.swing.JTabbedPane.indexOfComponent()


      // CraigM:23/07/2008 - Changed to JComponent as a JScrollPane can have captions too
      JComponent panel = (JComponent)this._component;
      panel.putClientProperty("qq_caption", this.caption.toString());
      if (panel.getParent() instanceof JTabbedPane){
        JTabbedPane tp = (JTabbedPane)panel.getParent();
        int index = tp.indexOfComponent(panel);
        tp.setTitleAt(index, caption.toString());
      }
      else if (panel instanceof GridField) {
        ((GridField)panel).setCaption(caption);
      }
View Full Code Here


      return ((RadioList)comp).getCaption();
    }
    JPanel panel = (JPanel)comp;
    if (panel.getParent() instanceof JTabbedPane) {
      JTabbedPane tp = (JTabbedPane)panel.getParent();
      int index = tp.indexOfComponent(panel);
      return index >=  0 ? new TextData(tp.getTitleAt(index)) : new TextData("");
    }
    else {
      Border border =  panel.getBorder();
      if (border instanceof TitledBorder) {
View Full Code Here

//                      setCaption(gf, mcat.getString(msgSet, msgNumber));
                        Caption.set(gf, mcat.getString(msgSet, msgNumber));
                    }
                    if ((gf.getParent() != null) && (gf.getParent() instanceof JTabbedPane)) {
                        JTabbedPane jt = (JTabbedPane) comp.getParent();
                        int index = jt.indexOfComponent(comp);
                        if (index != -1) {
                            jt.setTitleAt(index, mcat.getString(msgSet, msgNumber, jt.getTitleAt(index)));
                        }
                    }
View Full Code Here

      return ((RadioList)comp).getCaption();
    }
    JPanel panel = (JPanel)comp;
    if (panel.getParent() instanceof JTabbedPane) {
      JTabbedPane tp = (JTabbedPane)panel.getParent();
      int index = tp.indexOfComponent(panel);
      return index >=  0 ? new TextData(tp.getTitleAt(index)) : new TextData("");
    }
    else {
      Border border =  panel.getBorder();
      if (border instanceof TitledBorder) {
View Full Code Here

      // CraigM:23/07/2008 - Changed to JComponent as a JScrollPane can have captions too
      JComponent panel = (JComponent)this._component;
      panel.putClientProperty("qq_caption", this.caption.toString());
      if (panel.getParent() instanceof JTabbedPane){
        JTabbedPane tp = (JTabbedPane)panel.getParent();
        int index = tp.indexOfComponent(panel);
        tp.setTitleAt(index, caption.toString());
      }
      else if (panel instanceof GridField) {
        ((GridField)panel).setCaption(caption);
      }
View Full Code Here

      return ((RadioList)comp).getCaption();
    }
    JPanel panel = (JPanel)comp;
    if (panel.getParent() instanceof JTabbedPane) {
      JTabbedPane tp = (JTabbedPane)panel.getParent();
      int index = tp.indexOfComponent(panel);
      return index >=  0 ? new TextData(tp.getTitleAt(index)) : new TextData("");
    }
    else {
      Border border =  panel.getBorder();
      if (border instanceof TitledBorder) {
View Full Code Here

         * TabFolder
         */
        if (comp instanceof JTabbedPane) {
          JTabbedPane tp = (JTabbedPane)comp;
          // NB: Do not use getSelectedIndex() because the index has already changed at this point
          int index = tp.indexOfComponent(oldComp);
          s.push(new TabFocus(tp, index));
        }
        /*
         * TextField
         */
 
View Full Code Here

    protected void updateTab(Dockable dockable) {
        Component docked = getDockedComponent();
        if (docked instanceof JTabbedPane) {
            JTabbedPane tabs = (JTabbedPane) docked;
            int index = tabs.indexOfComponent(dockable.getComponent());
            if (index > -1) {
                tabs.setIconAt(index, dockable.getDockingProperties()
                               .getTabIcon());
                tabs.setTitleAt(index, dockable.getDockingProperties()
                                .getDockableDesc());
View Full Code Here

        }

        // if we're in a hidden tab, then bring the tab to the front
        if(parentComp.getParent() instanceof JTabbedPane) {
            JTabbedPane tabPane = (JTabbedPane)parentComp.getParent();
            int indx = tabPane.indexOfComponent(parentComp);
            if(indx!=tabPane.getSelectedIndex())
                tabPane.setSelectedIndex(indx);
        }
    }
View Full Code Here

      ((Window) parent).dispose();
    else if (parent instanceof JInternalFrame) {
      ((JInternalFrame) parent).dispose();
    } else if (parent instanceof JTabbedPane) {
      JTabbedPane pane = (JTabbedPane) parent;
      pane.remove(pane.indexOfComponent(this));
    }
  }

  private void packForm() {
    Component parent = getParentWindow();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.