javax.swing.JComponent.getComponentCount()方法的使用及代码示例

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

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

JComponent.getComponentCount介绍

暂无

代码示例

代码示例来源:origin: apache/pdfbox

public void changeData(byte[] bytes)
{
  if (mainPane.getComponentCount() > 0)
  {
    mainPane.removeAll();
  }
  HexModel model = new HexModel(bytes);
  mainPane.add(new HexEditor(model));
  mainPane.validate();
}

代码示例来源:origin: org.metawidget.modules/metawidget-all

@Override
  protected boolean isIgnored( JComponent component ) {

    return component instanceof Stub && component.getComponentCount() == 0;
  }
}

代码示例来源:origin: org.metawidget.modules.swing/metawidget-swing

@Override
  protected boolean isIgnored( JComponent component ) {

    return component instanceof Stub && component.getComponentCount() == 0;
  }
}

代码示例来源:origin: org.metawidget.modules.swing/metawidget-swing

@Override
  protected boolean isIgnored( JComponent component ) {

    return component instanceof Stub && component.getComponentCount() == 0;
  }
}

代码示例来源:origin: org.metawidget.modules/metawidget-all

@Override
  protected boolean isIgnored( JComponent component ) {

    return component instanceof Stub && component.getComponentCount() == 0;
  }
}

代码示例来源:origin: org.fudaa.framework.ebli/ebli-2d

public BCalqueLegendePanel getLegendePanel(final int _i) {
 if (_i >= 0 && (_i < pnLegendes_.getComponentCount())) {
  return ((BCalqueLegendePanel) pnLegendes_.getComponent(_i));
 }
 return null;
}

代码示例来源:origin: xyz.cofe/docking-frames-core

/**
 * Gets the number of buttons that are actually shown.
 * @return the number of buttons
 */
public int getNumberOfButtons(){
  return getContentPane().getComponentCount();
}

代码示例来源:origin: org.metawidget.modules.swing/metawidget-swing

/**
 * Overridden to build widgets just-in-time.
 * <p>
 * This method may be called by developers who wish to modify the created Components before they
 * are displayed.
 */
@Override
public int getComponentCount() {
  buildWidgets();
  return super.getComponentCount();
}

代码示例来源:origin: org.fudaa.framework.ebli/ebli-2d

public BCalqueAffichage getLegendDisplayAtPosition(final int _i) {
 if (_i >= 0 && (_i < pnLegendes_.getComponentCount())) {
  return ((BCalqueLegendePanel) pnLegendes_.getComponent(_i)).aff_;
 }
 return null;
}

代码示例来源:origin: org.metawidget.modules/metawidget-all

/**
 * Overridden to build widgets just-in-time.
 * <p>
 * This method may be called by developers who wish to modify the created Components before they
 * are displayed.
 */
@Override
public int getComponentCount() {
  buildWidgets();
  return super.getComponentCount();
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui

/**
 * @param _parent le composant  partir duquel la recherche commence
 * @param _name le nom du composant fils  chercher
 * @return le fils direct de _parent ayant le nom donne ou null si non trouve
 */
public static JComponent findChildByName(JComponent _parent, String _name) {
 if (_parent == null || _name == null) return null;
 for (int i = _parent.getComponentCount() - 1; i >= 0; i--) {
  if (_name.equals(_parent.getComponent(i).getName())) return (JComponent) _parent.getComponent(i);
 }
 return null;
}

代码示例来源:origin: com.github.arnabk/pgslookandfeel

public void installUI(JComponent c) {
  super.installUI(c);
  c.putClientProperty("gradientStart", UIManager.get("ToolBar.gradientStart"));
  c.putClientProperty("gradientEnd", UIManager.get("ToolBar.gradientEnd"));
  int limit = c.getComponentCount();
  for (int i = 0; i < limit; i++) {
    setToolBarUI((JComponent) c.getComponent(i));
  }
}

代码示例来源:origin: stackoverflow.com

JComponent editor = spinner.getEditor();
   int n = editor.getComponentCount();
   for (int i=0; i<n; i++)
   {
     Component c = editor.getComponent(i);
     if (c instanceof JTextField)
     {
       c.setForeground(Color.red);
       c.setBackground(Color.red);
     }
   }

代码示例来源:origin: girtel/Net2Plan

public void setColor(Color color)
  {
    JComponent editor = this.getEditor();
    int numberOfComps = editor.getComponentCount();
    for(int i = 0; i < numberOfComps; i++)
    {
      editor.getComponent(i).setBackground(color);
    }
  }
}

代码示例来源:origin: org.fudaa.framework.ebli/ebli-common

private void internSetFont(final JComponent _c, final Font _font) {
 for (int i = _c.getComponentCount() - 1; i >= 0; i--) {
  _c.getComponent(i).setFont(_font);
 }
}

代码示例来源:origin: nroduit/Weasis

private void selectAll(final JComponent parent, boolean selected) {
  for (int i = 0; i < parent.getComponentCount(); i++) {
    Component c = parent.getComponent(i);
    if (c instanceof AbstractButton) {
      ((AbstractButton) c).setSelected(selected);
    }
  }
  itemList.forEach(m -> m.setSelected(selected));
}

代码示例来源:origin: com.eas.platypus/platypus-js-calendar-widget

public static void setFocusableRecursive(Component aComp, boolean aValue) {
  aComp.setFocusable(aValue);
  if (aComp instanceof JComponent) {
    JComponent jComp = (JComponent) aComp;
    for (int i = 0; i < jComp.getComponentCount(); i++) {
      setFocusableRecursive(jComp.getComponent(i), aValue);
    }
  }
}

代码示例来源:origin: org.fudaa.framework.fudaa/fudaa-common

protected static void addKeyListener(final Component _c, final KeyListener _key) {
 if (_c != null) {
  _c.addKeyListener(_key);
  if (_c instanceof JComponent) {
   final JComponent jc = (JComponent) _c;
   for (int i = jc.getComponentCount() - 1; i >= 0; i--) {
    addKeyListener(jc.getComponent(i), _key);
   }
  }
 }
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public void setMainToolBar(BuToolBar _tb) {
 main_toolbar_ = _tb;
 if (!(getApp() instanceof BuSubApp)) {
  if ((content_.getComponentCount() > 1) && (content_.getComponent(1) != null)) content_.remove(1);
  if (main_toolbar_ != null) {
   content_.add(main_toolbar_, BuBorderLayout.NORTH);
   main_toolbar_.revalidate();
   // content_.doLayout();
   // content_.validate();
  }
 }
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

public static void toBack(JComponent aParent, JComponent aComp, int aCount) {
    int zOrder = aParent.getComponentZOrder(aComp);
    if ((zOrder + aCount) < aParent.getComponentCount()) {
      aParent.setComponentZOrder(aComp, zOrder + aCount);
      aParent.revalidate();
      aParent.repaint();
    }
  }
}

相关文章

JComponent类方法