- JDK :OpenJDK-11
- OS :CentOS 7.6.1810
- IDE :Eclipse 2019‑03
- typesetting :Markdown
package per.jizuiku.gui; import java.awt.Frame; /** * @author 給最苦 * @date 2019/06/30 * @blog www.cnblogs.com/jizuiku */ public class Demo { /** * @param args */ public static void main(String[] args) { Frame f = new Frame(); f.setSize(400, 400); // 窗體的大小能夠調整嗎? 不 f.setResizable(false); f.setVisible(true); } }
/** * Sets whether this frame is resizable by the user. * @param resizable {@code true} if this frame is resizable; * {@code false} otherwise. * @see java.awt.Frame#isResizable */ public void setResizable(boolean resizable) { boolean oldResizable = this.resizable; boolean testvalid = false; synchronized (this) { this.resizable = resizable; FramePeer peer = (FramePeer)this.peer; if (peer != null) { peer.setResizable(resizable); testvalid = true; } } // On some platforms, changing the resizable state affects // the insets of the Frame. If we could, we'd call invalidate() // from the peer, but we need to guarantee that we're not holding // the Frame lock when we call invalidate(). if (testvalid) { invalidateIfValid(); } firePropertyChange("resizable", oldResizable, resizable); }
感謝幫助過 給最苦 的人們。
Java、Groovy和Scala等基於JVM的語言,優秀,值得學習。
規範的命名和代碼格式等,有助於溝通和理解。
JVM的配置、監控與優化,比較實用,值得學習。java