沙漠中的鱼

欲上天堂,先下地狱
posts - 0, comments - 56, trackbacks - 0, articles - 119
  BlogJava :: 首页 ::  :: 联系 :: 聚合  :: 管理

日历

<2025年4月>
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

公告

一个批着狼皮的羊

开源框架

数据结构和算法

浏览器内核

资料下载

搜索

  •  

积分与排名

  • 积分 - 183255
  • 排名 - 315

网上看到Jtable中revalidate的说法

Posted on 2009-05-02 01:18 沙漠中的鱼 阅读(576) 评论(0)  编辑  收藏 所属分类: Java

问题:在找资料的时候看见JTabel用了setModel方法后会加上一个revalidate方法,
可我删了这个方法并没见有什么不同,请指点!

回答一:如果在application上有哪个component由于事件的触发而发生变化(比如,形状)的话,这个方法就是用来更新当前程序的界面用的,就相当于重画一下界面

回答二:The original author comments, very clear:


I added a revalidate to JTable in the case that the table structure
changes (columns/rows added/removed). This is necessary, since such an
operation changes the size parameters of the JTable. It makes JTable
behave more nicely in JScrollPane in an app I have here.

只有注册用户登录后才能发表评论。


网站导航: