javax.swing.JToolBar.getComponentAtIndex()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(105)

本文整理了Java中javax.swing.JToolBar.getComponentAtIndex()方法的一些代码示例,展示了JToolBar.getComponentAtIndex()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JToolBar.getComponentAtIndex()方法的具体详情如下:
包路径:javax.swing.JToolBar
类名称:JToolBar
方法名:getComponentAtIndex

JToolBar.getComponentAtIndex介绍

暂无

代码示例

代码示例来源:origin: groovy/groovy-core

/**
 * Support the subscript operator for JToolBar.
 *
 * @param self  a JToolBar
 * @param index the index of the tab component to get
 * @return the tab component at the given index
 * @since 1.6.4
 */
public static Component getAt(JToolBar self, int index) {
  return self.getComponentAtIndex(index);
}

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

/**
   * Support the subscript operator for JToolBar.
   *
   * @param self  a JToolBar
   * @param index the index of the tab component to get
   * @return the tab component at the given index
   * @since 1.6.4
   */
  public static Component getAt(JToolBar self, int index) {
    return self.getComponentAtIndex(index);
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy-jdk14

/**
   * Support the subscript operator for JToolBar.
   *
   * @param self  a JToolBar
   * @param index the index of the tab component to get
   * @return the tab component at the given index
   * @since 1.6.4
   */
  public static Component getAt(JToolBar self, int index) {
    return self.getComponentAtIndex(index);
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy-swing

/**
 * Support the subscript operator for JToolBar.
 *
 * @param self  a JToolBar
 * @param index the index of the tab component to get
 * @return the tab component at the given index
 * @since 1.6.4
 */
public static Component getAt(JToolBar self, int index) {
  return self.getComponentAtIndex(index);
}

代码示例来源:origin: org.apache.cayenne.modeler/cayenne-modeler

public void currentDbEntityChanged(EntityDisplayEvent e) {
    DbEntity entity = (DbEntity) e.getEntity();
    if(entity.getDataMap().getMappedEntities(entity).isEmpty()) {
      toolBar.getComponentAtIndex(4).setEnabled(false);
      toolBar.getComponentAtIndex(5).setEnabled(false);
    } else {
      toolBar.getComponentAtIndex(4).setEnabled(true);
      toolBar.getComponentAtIndex(5).setEnabled(true);
    }
  }
}

代码示例来源:origin: org.jspresso.framework/jspresso-swing-components

/**
 * Delegates to the internal editor pane.
 * @param b
 *          editable.
 * @see javax.swing.text.JTextComponent#setEditable(boolean)
 */
public void setEditable(boolean b) {
 editorPane.setEditable(b);
 int scCount = toolBar.getComponentCount();
 for (int i = 0; i < scCount; i++) {
  toolBar.getComponentAtIndex(i).setEnabled(b);
 }
 toolBar.setEnabled(b);
}

代码示例来源:origin: org.apache.cayenne.modeler/cayenne-modeler

@Override
  public void componentResized(ComponentEvent e) {
    int[] hidden, shown;
    if(getSize().width < (13 * defaultBtnWidth + 300)) {
      hidden = all;
      shown = empty;
    } else if(getSize().width < (16 * defaultBtnWidth + 300)) {
      hidden = removeAndCopy;
      shown = undo;
    } else if(getSize().width < (18 * defaultBtnWidth + 300)) {
      hidden = remove;
      shown = undoAndCopy;
    } else {
      hidden = empty;
      shown = all;
    }
    for(int i : hidden) {
      toolBar.getComponentAtIndex(i).setVisible(false);
    }
    for(int i : shown) {
      toolBar.getComponentAtIndex(i).setVisible(true);
    }
  }
});

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

Component comp= toolBar.getComponentAtIndex(j++);
Component comp= toolBar.getComponentAtIndex(j--);

代码示例来源:origin: org.apache.cayenne.modeler/cayenne-modeler

/**
 * Loads obj relationships into table.
 */
public void currentObjEntityChanged(EntityDisplayEvent e) {
  if (e.getSource() == this) {
    return;
  }
  ObjEntity entity = (ObjEntity) e.getEntity();
  // Important: process event even if this is the same entity,
  // since the inheritance structure might have changed
  if (entity != null) {
    rebuildTable(entity);
  }
  // if an entity was selected on a tree,
  // unselect currently selected row
  if (e.isUnselectAttributes()) {
    table.clearSelection();
  }
  ObjEntity objEntity = (ObjEntity) e.getEntity();
  if (objEntity.getSuperEntity() != null) {
    parentPanel.getToolBar().getComponentAtIndex(2).setEnabled(false);
  } else {
    parentPanel.getToolBar().getComponentAtIndex(2).setEnabled(true);
  }
}

代码示例来源:origin: org.apache.cayenne.modeler/cayenne-modeler

toolBar.getComponentAtIndex(4).setEnabled(false);
  toolBar.getComponentAtIndex(5).setEnabled(false);
} else {
  toolBar.getComponentAtIndex(4).setEnabled(true);
  toolBar.getComponentAtIndex(5).setEnabled(true);

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

j = 0;
Component comp = toolBar.getComponentAtIndex(j++);
  j = nComp - 1;
Component comp = toolBar.getComponentAtIndex(j--);

相关文章

JToolBar类方法