application1.java

来自「本实例介绍如何通过给定的url解析url,并获得url的信息及如何在java中获」· Java 代码 · 共 53 行

JAVA
53
字号
package dyngetsource;import javax.swing.UIManager;import java.awt.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class Application1 {  boolean packFrame = false;  //Construct the application  public Application1() {    DynGetSource frame = new DynGetSource();    //Validate frames that have preset sizes    //Pack frames that have useful preferred size info, e.g. from their layout    if (packFrame) {      frame.pack();    }    else {      frame.validate();    }    //Center the window    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();    Dimension frameSize = frame.getSize();    if (frameSize.height > screenSize.height) {      frameSize.height = screenSize.height;    }    if (frameSize.width > screenSize.width) {      frameSize.width = screenSize.width;    }    frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);    frame.setVisible(true);    Thread t=new Thread(frame);//建立线程    t.start();//启动线程  }  //Main method  public static void main(String[] args) {    try {      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());    }    catch(Exception e) {      e.printStackTrace();    }    new Application1();  }}

⌨️ 快捷键说明

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