windowutilities.java

来自「servletjsp一些应用程序」· Java 代码 · 共 45 行

JAVA
45
字号
import javax.swing.*;import java.awt.*;/** A few utilities that simplify using windows in Swing. *  <P> *  Taken from Core Servlets and JavaServer Pages 2nd Edition *  from Prentice Hall and Sun Microsystems Press, *  http://www.coreservlets.com/. *  &copy; 2003 Marty Hall; may be freely used or adapted. */public class WindowUtilities {  /** Tell system to use native look and feel, as in previous   *  releases. Metal (Java) LAF is the default otherwise.   */  public static void setNativeLookAndFeel() {    try {      UIManager.setLookAndFeel        (UIManager.getSystemLookAndFeelClassName());    } catch(Exception e) {      System.out.println("Error setting native LAF: " + e);    }  }  public static void setJavaLookAndFeel() {    try {      UIManager.setLookAndFeel        (UIManager.getCrossPlatformLookAndFeelClassName());    } catch(Exception e) {      System.out.println("Error setting Java LAF: " + e);    }  }  public static void setMotifLookAndFeel() {    try {      UIManager.setLookAndFeel        ("com.sun.java.swing.plaf.motif.MotifLookAndFeel");    } catch(Exception e) {      System.out.println("Error setting Motif LAF: " + e);    }  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?