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

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

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

JComponent.getMinimumSize介绍

暂无

代码示例

代码示例来源:origin: magefree/mage

private void setGUISize() {
  Font font = GUISizeHelper.gameRequestsFont;
  lblText.setFont(font);
  lblText.setMaximumSize(new Dimension(300 + font.getSize() * 15, 20 + font.getSize() * 5));
  lblText.setMinimumSize(new Dimension(300 + font.getSize() * 15, 20 + font.getSize() * 5));
  lblText.setPreferredSize(new Dimension(300 + font.getSize() * 15, 20 + font.getSize() * 5));
  btn1.setFont(font);
  btn1.setMinimumSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
  btn1.setMaximumSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
  btn1.setPreferredSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
  btn2.setFont(font);
  btn2.setMinimumSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
  btn2.setMaximumSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
  btn2.setPreferredSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
  btn3.setFont(font);
  btn3.setMinimumSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
  btn3.setMaximumSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
  btn3.setPreferredSize(new Dimension(50 + 4 * font.getSize(), 2 * font.getSize() + 10));
  JComponent c = ((BasicInternalFrameUI) this.getUI()).getNorthPane();
  c.setMinimumSize(new Dimension(c.getMinimumSize().width, font.getSize() + 10));
  c.setMaximumSize(new Dimension(c.getMaximumSize().width, font.getSize() + 10));
  c.setPreferredSize(new Dimension(c.getPreferredSize().width, font.getSize() + 10));
  c.setFont(font);
}

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

button.setMaximumSize(new Dimension(Integer.MAX_VALUE, button.getMinimumSize().height));
add(button);
button.setMaximumSize(new Dimension(Integer.MAX_VALUE, button.getMinimumSize().height));
add(button);
button.setMaximumSize(new Dimension(Integer.MAX_VALUE, button.getMinimumSize().height));
add(button);
label.setMaximumSize(new Dimension(Integer.MAX_VALUE, label.getMinimumSize().height));
add(label);
textField.setMaximumSize(new Dimension(Integer.MAX_VALUE, textField.getMinimumSize().height));
add(textField);
button.setMaximumSize(new Dimension(Integer.MAX_VALUE, button.getMinimumSize().height));
add(button);

代码示例来源:origin: com.levigo.jbig2/levigo-jbig2-imageio

/**
 * Gets the minimum Size of the Component
 * 
 * @param image java.awt.Image
 */
public Dimension getMinimumSize() {
 if (prefSize != null)
  return prefSize;
 else
  return super.getMinimumSize();
}

代码示例来源:origin: net.sf.doolin/doolin-gui

/**
 * Calculates the minimum size dimensions for the specified container,
 * given the components it contains.
 * 
 * @param parent
 *            the component to be laid out
 * @return the minimum size of the given container
 * @see #preferredLayoutSize(Container)
 */
public Dimension minimumLayoutSize(Container parent) {
  return IconFeedbackPanel.this.content.getMinimumSize();
}

代码示例来源:origin: org.bidib.jbidib.eu.hansolo/SteelSeries

@Override
public Dimension getMinimumSize() {
  Dimension dim = super.getMinimumSize();
  if (dim.width < 24 || dim.height < 24) {
    dim = new Dimension(24, 24);
  }
  return dim;
}

代码示例来源:origin: org.bidib.jbidib.eu.hansolo/SteelSeries

@Override
public Dimension getMinimumSize() {
  Dimension dim = super.getMinimumSize();
  if (dim.width < 64 || dim.height < 32) {
    dim = new Dimension(64, 32);
  }
  return dim;
}

代码示例来源:origin: org.bidib.jbidib.eu.hansolo/SteelSeries

@Override
public Dimension getMinimumSize() {
  Dimension dim = super.getMinimumSize();
  if (dim.width < 64 || dim.height < 24) {
    dim = new Dimension(64, 24);
  }
  return dim;
}

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

public Dimension getMinimumSize() {
  if (fontHeight < 0) {
    return super.getMinimumSize();
  }
  Dimension d = new Dimension(4 * fontHeight, 4 * fontHeight);
  return d;
}

代码示例来源:origin: org.bidib.jbidib.eu.hansolo/SteelSeries

@Override
public Dimension getMinimumSize() {
  Dimension dim = super.getMinimumSize();
  if (dim.width < 40 || dim.height < 18) {
    dim = new Dimension(40, 18);
  }
  return dim;
}

代码示例来源:origin: org.netbeans.api/org-openide-explorer

@Override
public Dimension getMinimumSize() {
  if (fontHeight < 0) {
    return super.getMinimumSize();
  }
  Dimension d = new Dimension(4 * fontHeight, 4 * fontHeight);
  return d;
}

代码示例来源:origin: HanSolo/SteelSeries-Swing

@Override
public Dimension getMinimumSize() {
  Dimension dim = super.getMinimumSize();
  if (dim.width < 24 || dim.height < 24) {
    dim = new Dimension(24, 24);
  }
  return dim;
}

代码示例来源:origin: HanSolo/SteelSeries-Swing

@Override
public Dimension getMinimumSize() {
  Dimension dim = super.getMinimumSize();
  if (dim.width < 64 || dim.height < 24) {
    dim = new Dimension(64, 24);
  }
  return dim;
}

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

@Override
 public Dimension getMinimumSize() {
  return myAnchor == null || myAnchor == this ? super.getMinimumSize() : myAnchor.getMinimumSize();
 }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

/** Returns minimum size that this component can occupy. Because javadoc can be omitted, 
 *  the minimum size is the minimum size of code completion */
public Dimension getMinimumSize(){
  return completion.getComponent().getMinimumSize();
}

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

@Override
public Dimension getMinimumSize() {
  if( contentPane == null ){
    return super.getMinimumSize();
  }
  return contentPane.getMinimumSize();
}

代码示例来源:origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

@Override
public Dimension getMinimumSize(){
  if( actions.isEmpty() )
    return new Dimension( 0, 0 );
  
  if( menuItem == null )
    return getPreferredSize();
  
  return menuItem.getItem().getMinimumSize();
}

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

@Override
public Dimension getMinimumSize() {
  Dimension size = getActualComponent() == null ? new Dimension(0, 0) : getActualComponent().getMinimumSize();
  Insets insets = getOverlayLocationInsets();
  if (insets != null) {
    size.width += Math.max(0, insets.left) + Math.max(0, insets.right);
    size.height += Math.max(0, insets.top) + Math.max(0, insets.bottom);
  }
  return size;
}

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

public int getToFitLength(final SingleRowPassInfo data) {
 if (data.hToolbar != null) {
  return myTabs.getWidth() - data.insets.left - data.insets.right - data.hToolbar.getMinimumSize().width;  
 } else {
  return myTabs.getWidth() - data.insets.left - data.insets.right;
 }
}

代码示例来源:origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

@Override
public Dimension getMinimumSize(){
  if( isMinimumSizeSet() )
    return super.getMinimumSize();
  
  return getPreferredSize();
}

代码示例来源:origin: com.github.insubstantial/flamingo

private void addScrollers() {
  this.scrollablePanel.add(this.leadingScroller);
  this.scrollablePanel.add(this.trailingScroller);
  this.scrollablePanel.revalidate();
  JComponent view = this.scrollablePanel.getView();
  view.setPreferredSize(view.getMinimumSize());
  view.setSize(view.getMinimumSize());
  this.scrollablePanel.doLayout();
  this.scrollablePanel.repaint();
}

相关文章

JComponent类方法