当前位置: 代码迷 >> J2SE >> setBounds(Rectangle r)与setBounds(int,int,int,int)的差异
  详细解决方案

setBounds(Rectangle r)与setBounds(int,int,int,int)的差异

热度:472   发布时间:2016-04-24 13:04:36.0
setBounds(Rectangle r)与setBounds(int,int,int,int)的区别
RT

------解决方案--------------------
感觉差不多
------解决方案--------------------
r 是Rectangle对象的一个数
例如setBuonds(new Rectangle(1,2,400,300) );
和setBounds(1,2,400,300);是一个道理
写上面的 那种以后好维护点

------解决方案--------------------
差不多的...
我个人喜欢用下面的.
------解决方案--------------------
关注
------解决方案--------------------
其实是一样的,只不过setBounds(Rectangle r)是直接传入一个Rectangle对象,而setBounds(int,int,int,int)可能是通过这些参数再构造一个Rectangle对象而已。
  相关解决方案