setSize() is under the context of frame, this is not static. 
if you call setSize() directly in main(), no context, and thus the static context, is around it. 

解决方案 »

  1.   

    一个基本概念问题:静态函数只能调用静态方法,类的成员函数也是静态的吗?这是那里来得概念阿/*--by bookbobby(书呆)-+
     |            |
     |  你说爱我只是习惯  |
     |  再也不是喜欢    |
     |  我给你的爱     |
     |  已不再温暖     |
     |            |
     +--by bookbobby(书呆)-*/
      

  2.   

    public void print(String msg)
    {
       System.out.println(msg);
    }
    public static void main(String[] args)
    {
      JFrame frame=new JFrame();//这样先new就不是一个静态方法
      frame.print("hello");
    }
    public static void print(String msg)
    {
       System.out.println(msg);
    }
    public static void main(String[] args)
    {
      print("hello");//不new直接调用就必须是一个静态方法
    }
      

  3.   

    静态方法可以直接调用另一个静态方法
    通过静态方法中的local-field,可以调用非静态方法
      

  4.   

    hahaha88(忧郁的眼神,稀嘘的胡子喳) 
    可否举个例子??
      

  5.   

    public class Test{
        static void method1(){}
        void method2(){}    public static void main(String[] args){
            method1();
            Test test=new Test(); test.method2();
        }
    }