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

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

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

JSpinner.getMinimumSize介绍

暂无

代码示例

代码示例来源:origin: org.rescarta.rc-indexer/rc-indexer

public Dimension getMinimumSize() {
  Dimension d = super.getMinimumSize();
  d.width = this.width;
  return d;
}

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

@Override
  public Dimension getMaximumSize() {
    Dimension d = new Dimension();
    d.width = super.getMaximumSize().width;
    d.height = Math.max(jLabelTitle.getMinimumSize().height, spinner.getMinimumSize().height) + 2*VERTICAL_MARGIN;
    return d;
  }
}

代码示例来源:origin: org.scijava/scijava-ui-swing

/**
 * Limit component width to a certain maximum. This is a HACK to work around
 * an issue with Double-based spinners that attempt to size themselves very
 * large (presumably to match Double.MAX_VALUE).
 */
private void limitWidth(final int maxWidth) {
  final Dimension minSize = spinner.getMinimumSize();
  if (minSize.width > maxWidth) {
    minSize.width = maxWidth;
    spinner.setMinimumSize(minSize);
  }
  final Dimension prefSize = spinner.getPreferredSize();
  if (prefSize.width > maxWidth) {
    prefSize.width = maxWidth;
    spinner.setPreferredSize(prefSize);
  }
}

代码示例来源:origin: net.imagej/ij-ui-swing

/**
 * Limit component width to a certain maximum. This is a HACK to work around
 * an issue with Double-based spinners that attempt to size themselves very
 * large (presumably to match Double.MAX_VALUE).
 */
private void limitWidth(final int maxWidth) {
  final Dimension minSize = spinner.getMinimumSize();
  if (minSize.width > maxWidth) {
    minSize.width = maxWidth;
    spinner.setMinimumSize(minSize);
  }
  final Dimension prefSize = spinner.getPreferredSize();
  if (prefSize.width > maxWidth) {
    prefSize.width = maxWidth;
    spinner.setPreferredSize(prefSize);
  }
}

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

spinner.setMaximumSize(new Dimension(spinner.getMaximumSize().width, spinner.getMinimumSize().height));
spinner.setMinimumSize(new Dimension(10, spinner.getMinimumSize().height));

相关文章