沙漠中的魚

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

          網上看到Jtable中revalidate的說法

          Posted on 2009-05-02 01:18 沙漠中的魚 閱讀(577) 評論(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.
          主站蜘蛛池模板: 拉孜县| 冕宁县| 同德县| 来宾市| 体育| 上犹县| 红桥区| 诸暨市| 周口市| 滕州市| 芜湖市| 收藏| 清河县| 泸水县| 高州市| 宿迁市| 瑞安市| 惠来县| 安徽省| 海丰县| 克什克腾旗| 平南县| 龙陵县| 呼图壁县| 江津市| 神木县| 凌源市| 金华市| 清新县| 象山县| 普宁市| 金寨县| 盈江县| 建始县| 改则县| 天门市| 利辛县| 五家渠市| 启东市| 扎鲁特旗| 定南县|