javax.swing.JLabel.getMinimumSize()方法的使用及代码示例

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

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

JLabel.getMinimumSize介绍

暂无

代码示例

代码示例来源:origin: geotools/geotools

/**
   * Checks the current label width against its minimum width and, if the current width is larger,
   * adjusts the minimum to prevent the label growing and shrinking as the cursor is moved.
   */
  private void ensureMinLabelWidth() {
    Dimension minDim = label.getMinimumSize();
    Dimension curDim = label.getSize();

    if (curDim.width > minDim.width) {
      label.setMinimumSize(new Dimension(curDim.width, minDim.height));
    }
  }
}

代码示例来源:origin: org.ihtsdo/wb-api

@Override
public Dimension getMinimumSize() {
  if (lineWrapEnabled) {
    return wrapSize;
  }
  return super.getMinimumSize();
}

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

/**
 * Gets the MinimumSize attribute of the SkinDesktopIconUI object
 *
 * @param c  Description of Parameter
 * @return   The MinimumSize value
 */
public Dimension getMinimumSize(JComponent c) {
 return iconPane.getMinimumSize();
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor

/**
   * A crude attempt at preventing the label from expanding itself or its parent.
   */
  @Override
  public Dimension getMinimumSize() {
    Dimension size = super.getMinimumSize();
    size.width = 0;
    return size;
  }
}

代码示例来源:origin: tflobbe/solrmeter

@Override
public int getFirstColumnWidth() {
  return jLabelTitle.getMinimumSize().width;
}

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

@Override
  public Dimension getMinimumSize() {
    return new Dimension(0, super.getMinimumSize().height);
  }
};

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-inspect

@Override
  public Dimension getMinimumSize() {
    // Allow horizontal shrinking of Browser DOM view below pref./min. size
    Dimension dim = super.getMinimumSize();
    return new Dimension(0, dim.height);
  }
};

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

/** Creates new form StarterPanel */
public StarterCommonPanel() {
  initComponents();
  jLabelSerialNumber.setPreferredSize(jLabelSerialNumber.getMinimumSize());
  jLabelPartNumber.setPreferredSize(jLabelSerialNumber.getMinimumSize());
  jLabelPartRev.setPreferredSize(jLabelSerialNumber.getMinimumSize());
  jLabelTestType.setPreferredSize(jLabelSerialNumber.getMinimumSize());
}

代码示例来源:origin: org.bidib.jbidib.com.vldocking/vldocking

public Dimension getMinimumSize() {
  if(zone == DockingConstants.INT_HIDE_TOP || zone == DockingConstants.INT_HIDE_BOTTOM) {
    return super.getMinimumSize();
  } else {
    Insets i = getInsets();
    Dimension d = super.getMinimumSize();
    return new Dimension(d.height - i.top - i.bottom + i.left + i.right, d.width - i.left - i.right + i.top + i.bottom); // rotate the shape
  }
}

代码示例来源:origin: RPTools/maptool

public Dimension getMinimumSize() {
  Dimension d = super.getMinimumSize();
  if (isRotated()) {
    int width = d.width;
    d.width = d.height;
    d.height = width;
  }
  return d;
}

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

@Override
public Dimension minimumLayoutSize( Container parent ){
  Dimension textDimension = text.getMinimumSize();
  Dimension lineDimension = line.getMinimumSize();
  
  int width = Math.max( textDimension.width + textInsets.left + textInsets.right, lineDimension.width ) + insets.left + insets.right;
  int height = Math.max( textDimension.height + textInsets.top + textInsets.bottom, lineDimension.height ) + insets.top + insets.bottom;
  return new Dimension( width, height );
}

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

public Dimension getMinimumSize()
{
 if((delegate_==this)||(delegate_==null))
  return super.getMinimumSize();
 return delegate_.getMinimumSize();
}

代码示例来源:origin: org.apache.poi/poi-examples

@Override
 public Dimension getMinimumSize() {
  Dimension d = super.getMinimumSize();
  if (row >= 0) {
   d.height = getRowHeight(row);
  }
  return d;
 }
}

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

@Override
public Dimension getMinimumSize() {
  return isLineWrap() ? new Dimension(1, 1) : super.getMinimumSize();
}

代码示例来源:origin: net.sf.ingenias/editor

@Override
public Dimension getMinimumSize() {
  if (getText().length()==0 && getIcon()==null)
    return new Dimension(0,0);
  else
    return super.getMinimumSize();
}

代码示例来源:origin: tflobbe/solrmeter

@Override
public void setFirstColumnWidth(int width) {
  Dimension d = (Dimension)jLabelLabel.getMinimumSize().clone();
  d.width = width;
  jLabelLabel.setMinimumSize(d);
  jLabelLabel.setPreferredSize(d);
  jLabelLabel.setMaximumSize(d);
}

代码示例来源:origin: tflobbe/solrmeter

@Override
public void setFirstColumnWidth(int width) {
  Dimension d = (Dimension)jLabelTitle.getMinimumSize().clone();
  d.width = width;
  jLabelTitle.setMinimumSize(d);
  jLabelTitle.setPreferredSize(d);
  jLabelTitle.setMaximumSize(d);
}

代码示例来源:origin: eu.mihosoft.vrl/vrl

@Override
public Insets getBorderInsets(Component arg0) {
  int titleHeight = (int) titleLabel.getMinimumSize().getHeight();
  return new Insets(getTopMargin() + titleHeight / 2, getLeftMargin(),
      getBottomMargin(), getRightMargin());
}

代码示例来源:origin: JetBrains/jediterm

@Override
public Dimension getMinimumSize() {
 if (myAnchor != null && myAnchor != this) return myAnchor.getMinimumSize();
 if (myEditorPane != null) return getLayout().minimumLayoutSize(this);
 return super.getMinimumSize();
}

代码示例来源:origin: hmvictor/radar-netbeans

public static void showRule(Frame owner, Rule rule) {
  RuleDialog dialog=new RuleDialog(owner, true);
  dialog.setLocationRelativeTo(owner);
  dialog.setRule(rule);
  int minWidth = Math.max(dialog.getWidth(), dialog.ruleTitle.getMinimumSize().width);
  dialog.setSize(minWidth+50, dialog.getHeight());
  dialog.setVisible(true);
  dialog.dispose();
}

相关文章

JLabel类方法