java.awt.Window.getMinimumSize()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(144)

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

Window.getMinimumSize介绍

暂无

代码示例

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

public static void adjustWindowToMinimumSize(final Window window) {
  if (window == null) return;
  final Dimension minSize = window.getMinimumSize();
  final Dimension size = window.getSize();
  final Dimension newSize = new Dimension(Math.max(size.width, minSize.width), Math.max(size.height, minSize.height));
  if (!newSize.equals(size)) {
    //noinspection SSBasedInspection
    SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        if (window.isShowing()) {
          window.setSize(newSize);
        }
      }
    });
  }
}

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

public static void setupEnclosingDialogBounds(final JComponent component) {
  component.revalidate();
  component.repaint();
  final Window window = SwingUtilities.windowForComponent(component);
  if (window != null &&
      (window.getSize().height < window.getMinimumSize().height || window.getSize().width < window.getMinimumSize().width)) {
    window.pack();
  }
}

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

/**
 * Sets the Shaded attribute of the SkinWindowWindow object
 * 
 * @param b The new Shaded value
 */
public void setShaded(boolean b) {
 java.awt.Window window = (frame == null)?(java.awt.Window)dialog
   :(java.awt.Window)frame;
 if (window == null || b == shaded) { return; }
 if (b == true) {
  Rectangle bounds = window.getBounds();
  oldBounds = new Rectangle(bounds.x, bounds.y, bounds.width,
    bounds.height);
  window.setBounds(oldBounds.x, oldBounds.y, oldBounds.width, window
    .getMinimumSize().height - 2);
 } else {
  Point location = window.getLocation();
  window.setBounds(location.x, location.y, oldBounds.width,
    oldBounds.height);
  oldBounds = null;
 }
 shaded = b;
}

代码示例来源:origin: org.gosu-lang.gosu/gosu-lab

if( owner != null && owner.isShowing() && (owner.getMinimumSize().height < owner.getHeight()) )

代码示例来源:origin: org.gosu-lang.gosu/gosu-editor

if( owner != null && owner.isShowing() && (owner.getMinimumSize().height < owner.getHeight()) )

代码示例来源:origin: org.gosu-lang.gosu/gosu-editor

if( owner != null && owner.isShowing() && (owner.getMinimumSize().height < owner.getHeight()) )

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

Rectangle r = w.getBounds();
Rectangle startBounds = new Rectangle(r);
Dimension min = w.getMinimumSize();

代码示例来源:origin: org.java.net.substance/substance

Rectangle r = w.getBounds();
Rectangle startBounds = new Rectangle(r);
Dimension min = w.getMinimumSize();

代码示例来源:origin: khuxtable/seaglass

Rectangle r           = w.getBounds();
Rectangle startBounds = new Rectangle(r);
Dimension min         = w.getMinimumSize();

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

Dimension min = w.getMinimumSize();

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

Rectangle r = w.getBounds();
Rectangle startBounds = new Rectangle(r);
Dimension min = w.getMinimumSize();

相关文章

Window类方法