Search:

Type: Posts; User: copeg

Search: Search took 0.17 seconds.

  1. Replies
    9
    Views
    9,760

    Re: JTable prepareRenderer changes all cell colors

    This may be due to the way you are iterating through your Vector. Try something like


    if ( vRows.contains(row) ){
    comp.setBackground(Color.LIGHT_GRAY);
    }else{
    ...
  2. Replies
    9
    Views
    9,760

    Re: JTable prepareRenderer changes all cell colors

    For what its worth, the reason you are receiving this behavior is because the renderer reuses the components. The solution is to reset the color in the prepareRenderer method


    if (row ==...
Results 1 to 2 of 2