java布局中,比如BorderLayout布局中的按钮大小好像都是根据按钮上的文字长度自动适应的是吧?我想手动设置按钮的大小应该设置?

解决方案 »

  1.   

    可以在写文字的时候加空格, 
    也可以设置它的size , 应该有这个属性吧, 你试试 我一般是假空格就OK了
      

  2.   

    setBounse(x,y,width,height);好像是这么个方法
      

  3.   

    当然有:
    setBounds(int x, int y, int width, int height)
    Parameters:
    x the new x coordinate for the receiver
    y the new y coordinate for the receiver
    width the new width for the receiver
    height the new height for the receiver