java命名空间javax.swing类jlist的类成员方法:
setprototypecellvalue定义及介绍
本文导语:
setprototypecellvalue
public void setprototypecellvalue(object prototypecellvalue)
设置 prototypecellvalue 属性,然后(如果新值为非 null)计算 fixedcellwidth 和 fixedcellheight 属性:请求单元渲染器组件提供单元渲染器的给定值(及索引 0),并使用该...
setprototypecellvalue
public void setprototypecellvalue(object prototypecellvalue)
- 设置
prototypecellvalue 属性,然后(如果新值为非 null)计算 fixedcellwidth 和 fixedcellheight 属性:请求单元渲染器组件提供单元渲染器的给定值(及索引 0),并使用该组件的首选大小。
当由于列表过长而不允许 listui 计算每个单元的宽度/高度,并且已知某个单元值(所谓的原型)所占用的空间与任何其他单元一样多时,此方法很有用。
尽管 prototypecellvalue、fixedcellheight 和 fixedcellwidth 三个属性都可以由此方法进行修改时,但只有 prototypecellvalue 属性更改时才发送 propertychangeevent 通知。
要查看设置此属性的示例,请参见上述类描述。
此属性的默认值为 null。
这是一个 javabeans 绑定属性。
- 参数:
prototypecellvalue - 作为 fixedcellwidth 和 fixedcellheight 的基础的值- 另请参见:
getprototypecellvalue(),
setfixedcellwidth(int),
setfixedcellheight(int),
container.addpropertychangelistener(java.beans.propertychangelistener)