当前位置: 代码迷 >> J2SE >> 麻烦向各位大师问一下:小弟我编的这个LayoutUtil.java源文件有什么东东
  详细解决方案

麻烦向各位大师问一下:小弟我编的这个LayoutUtil.java源文件有什么东东

热度:95   发布时间:2016-04-24 14:56:21.0
麻烦向各位大师问一下:我编的这个LayoutUtil.java源文件有什么错误?
源程序:
package   edu.njust.cs;

import   javax.swing.*;
import   java.awt.*;

public   class   LayoutUtil{
public   static   void   add(Container   con,int   fill,int   anchor,int   weightx,int   weighty,int   x,int   y,   int   width,int   height,Component   comp)
{
GridBagConstraints   constraints=new   GridBagConstraints();

constraints.fill=fill;
constraints.anchor=anchor;
constraints.weightx=weightx;
constraints.weighty=weighty;
constraints.gridx=x;
constraints.gridy=y;
constraints.gridwidth=width;
constraints.gridheight=height;
con.add(comp,constraints);
}
public   static   void   add(Container   con,int   fill,int   anchor,int   weightx,int   weighty,int   x,int   y,int   width,int   height,Component   comp,Insets   in){
GridBagConstraints   constraints=new   GridBagConstraints();
constraints.insets=in;
constraints.fill=fill;
constraints.anchor=anchor;
constraints.weightx=weightx;
constraints.weighty=weighty;
constraints.gridx=x;
constraints.gridy=y;;
constraints.gridwidth=width;
constraints.gridheight=height;
con.add(comp,constraints);
}
}

这个是运行结果的抓图http://w3.886.cn/4tLN/21741701/21741701_9427.jpg

------解决方案--------------------
顶了!
  相关解决方案