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

x33g5p2x  于2022-01-15 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(121)

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

AbstractButton.getComponentCount介绍

暂无

代码示例

代码示例来源:origin: com.jidesoft/jide-oss

public static Dimension getPreferredButtonSize(AbstractButton b, int textIconGap, boolean isHorizontal) {
  if (b.getComponentCount() > 0) {
    return null;
  }
  Icon icon = b.getIcon();
  String text = b.getText();
  Font font = b.getFont();
  FontMetrics fm = b.getFontMetrics(font);
  Rectangle iconR = new Rectangle();
  Rectangle textR = new Rectangle();
  Rectangle viewR = new Rectangle(Short.MAX_VALUE, Short.MAX_VALUE);
  layoutCompoundLabel(b, fm, text, icon, isHorizontal,
      b.getVerticalAlignment(), b.getHorizontalAlignment(),
      b.getVerticalTextPosition(), b.getHorizontalTextPosition(),
      viewR, iconR, textR, (text == null ? 0 : textIconGap));
  /* The preferred size of the button is the size of
   * the text and icon rectangles plus the buttons insets.
   */
  Rectangle r = iconR.union(textR);
  Insets insets = b.getInsets();
  r.width += insets.left + insets.right;
  r.height += insets.top + insets.bottom;
  return r.getSize();
}

代码示例来源:origin: org.swinglabs.swingx/swingx-core

if (b.getComponentCount() > 0) {
  return null;

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

if (b.getComponentCount() > 0) {
  return null;

代码示例来源:origin: org.swinglabs.swingx/swingx-all

if (b.getComponentCount() > 0) {
  return null;

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

if (b.getComponentCount() > 0) {
  return null;

代码示例来源:origin: org.codehaus.jtstand/jtstand-desktop

if (b.getComponentCount() > 0) {
  return null;

相关文章

微信公众号

最新文章

更多

AbstractButton类方法