Redian新闻
>
空的JList什么也不显示,一定要加了数据再改变大小时才会出来
avatar
空的JList什么也不显示,一定要加了数据再改变大小时才会出来# Java - 爪哇娇娃
h*0
1
但是如果程序启动时有数据项,就会正常显示。为啥?
avatar
s*e
2
Can you check the source code by yourslef? As I remember that even the data
model is null, the JList can be shown. (maybe I am wrong).
改变大小 will trigger the paintmanager to redraw the component. you can
always force to redraw compoenent in java swing.
avatar
h*0
3
thanks a lot!
I didn't solve that problem coz when I add something else at the right of
the JList, the problem disappears.
I think I have to set the size of the JList(or outside JScrollPane), but i
don't know how to do it and not to interfere with the auto size according to
visible row count.

data

【在 s******e 的大作中提到】
: Can you check the source code by yourslef? As I remember that even the data
: model is null, the JList can be shown. (maybe I am wrong).
: 改变大小 will trigger the paintmanager to redraw the component. you can
: always force to redraw compoenent in java swing.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。