refreshing background color for a row in jtable

后端 未结 2 979
遥遥无期
遥遥无期 2020-11-22 16:36

i am trying to set the color of row of a Swing Jtable. i use this class to extend Jtable as suggest on the net.

    public class ColorTable extends JTable {
         


        
2条回答
  •  北荒
    北荒 (楼主)
    2020-11-22 17:22

    It may sound wired myself answering to one of my questions. but I found another quck fix to my bug. but am not really sure about the reason. I call a epaint just before the validate and everything works fine:

    deployTable.repaint();
    deployTable.revalidate();
    

    I think i have not really clear the difference within repaint and revalidate. Can anyone explain it to me?

提交回复
热议问题