setBounds(int x, int y,int width, int height)
在构造函数中调这个函数重画这个组件

解决方案 »

  1.   

    shanmao(山猫)
    你的意思是在别处创建这个Frame
    然后在这个类里重画这个Frame是吗?可是现在我想在这个类里创建并现实Frame
      

  2.   

    class p extends Frame
    {
      int x;
      int y;
      int width;
      int height;  public p(int x, int y, int width, int height)    //重载构造函数
      {
        super();
        setBounds(x,y,width,height);
      }
    }p.s.:偶也是刚学java,希望和各位多多交流。。