我的一点看法
Toolkit kit=new Toolkit();和
Toolkit kit=Toolkit.getDefaultToolkit();
两个都可以用吧,只是第一个是创建新对象,第二个是引用系统中已有的对象

解决方案 »

  1.   

    Dimension就是一个描述二维宽和高的类吧,用来封装组件的宽和高属性值(只支持整型),这样有些组件的方法中返回组件大小,就不用分别返回宽和高了!
    dimension这个词本身就是维(2维,3维)的意思呀!
    如果还又不明白的,看看下面这个网址,也有下载版本,好像30多兆呢!
    http://java.sun.com/j2se/1.4.1/docs/api/
      

  2.   

    实现Toolkit 在每个操作系统中不一样,所以要子类化,为了移植性采用静态方法获取平台地缺省Toolkit .
      

  3.   

    静态方法。
    有些类利用它的静态方法来产生一个引用。而不是用new 生成新对像
    如http中一些类。
      

  4.   

    例如:Toolkit kit=Toolkit.getDefaultToolkit();;就是通过静态方法获得一个Toolkit.
    而不是Toolkit kit=new Toolkit()用new运算符创建对像。
      

  5.   

    如: wyhgg(石头) 所说,概念上是不同的。这很重要!
      

  6.   

    getDefaultToolkit()是Toolkit类的一个静态工厂方法,返回一个Toolkit类的实例!
      

  7.   

    Toolkit 类是初象类不能用new关键字初始化
      

  8.   

    這應是一個單例模式的實現﹐因為Toolkit的實例只會有一個﹐所以不需要它的多個實例﹐以下是我推測的代嗎.你有時間興趣的話自已看看源代嗎吧.public class Toolkit{
      private static Toolkit defaultToolkit = null;
      //構造方法私有﹐別人無法調用
      private Toolkit(){
       ..
      }
      //當沒有Toolkit實例時﹐新建實例﹐否則﹐返回以前建好的實例
      public static Toolkit getDefaultToolkit(){
        if (defaultToolkit == null){
           defaultToolkit = new Toolkit();
           return defaultToolkit;
        }
        else
           return this.defaultToolkit;
      }
      
    }
      

  9.   

    ToolKit:
    /**
     * This class is the abstract superclass of all actual
     * implementations of the Abstract Window Toolkit. Subclasses of
     * <code>Toolkit</code> are used to bind the various components
     * to particular native toolkit implementations.
     * <p>
     * Most applications should not call any of the methods in this
     * class directly. The methods defined by <code>Toolkit</code> are
     * the "glue" that joins the platform-independent classes in the
     * <code>java.awt</code> package with their counterparts in
     * <code>java.awt.peer</code>. Some methods defined by
     * <code>Toolkit</code> query the native operating system directly.
      

  10.   

    public static synchronized Toolkit getDefaultToolkit() {
    if (toolkit == null) {
        try {
    // We disable the JIT during toolkit initialization.  This
    // tends to touch lots of classes that aren't needed again
    // later and therefore JITing is counter-productiive.
    java.lang.Compiler.disable();         java.security.AccessController.doPrivileged(
    new java.security.PrivilegedAction() {
        public Object run() {
            String nm = null;
    Class cls = null;
            try {
        nm = System.getProperty("awt.toolkit",
    "sun.awt.motif.MToolkit");
        try {
         cls = Class.forName(nm);
                } catch (ClassNotFoundException e) {
         ClassLoader cl = ClassLoader.getSystemClassLoader();
                                    if (cl != null) {
             try {
                                            cls = cl.loadClass(nm);
                     } catch (ClassNotFoundException ee) {
         throw new AWTError("Toolkit not found: " + nm);
        }
                                    }
                        }
                                if (cls != null) {
    toolkit = (Toolkit)cls.newInstance();
                                    if (GraphicsEnvironment.isHeadless()) {
                                        toolkit = new HeadlessToolkit(toolkit);
                                    }
        }
            } catch (InstantiationException e) {
        throw new AWTError("Could not instantiate Toolkit: " +
       nm);
            } catch (IllegalAccessException e) {
        throw new AWTError("Could not access Toolkit: " + nm);
            }
            return null;
        }
            });
            loadAssistiveTechnologies();     } finally {
    // Make sure to always re-enable the JIT.
    java.lang.Compiler.enable();
        }
    }
    return toolkit;
        }