• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Intializing Cell Renderers on click spans multiple action

 
Manju Krishna
Ranch Hand
Posts: 48
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have CellRenderers implemented for sorting Jtable columns..
In my panel.. i have a clear button which will clear table contents and should also clear the cell renderers on the columns already present..
On click of clear button i tried to initialise the CellRenderers again on the colums...
But on clicking the column headers for sorting.. the column listeners are getting caled twice and so the sorting does not happen..
Please help.

The code snippet of initialising renderer is as below..


 
K. Tsang
Bartender
Posts: 3404
13
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How many times you physically call initCellRenderer() method? Or can you make the renderer (SortButtonRender class) into instance variable and null it when clear button is clicked?
 
Manju Krishna
Ranch Hand
Posts: 48
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i call it thrice ..

on initComponents() of the panel..

on clear button and one more search button..

i cant make it null because the renderer has to work on subsequently when table is populated again with data
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic