This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • 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: 3348
12
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