Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with setCellEditor()  RSS feed

 
Radek Gajdos
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i'm trying to set custom cell editor, i have found example in internet http://exampledepot.8waytrips.com/egs/javax.swing.table/CustEdit.html, i have adopted it to my expectations, but i get an error which is "Syntax error on token "setCellEditor", = expected after this token", i'm using eclipse, and i don't know what to do next to get rid off this error, any help is welcome. Below my code.
 
Rob Camick
Ranch Hand
Posts: 2754
12
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are trying to execute code in the body of the class where you define your variables.



The above line of code should be moved to the constructor of your class.




 
Radek Gajdos
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have made some changes in my code, and it compiles now but after i have added new row i don't get JSpinner as cell editor in second column, and when i try to edit cell in that column by doubleclick, an exception occurs.

And below my entire code.

Any advices what to do next?
 
Radek Gajdos
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem was in the empty cells after adding new row, so i added some extra code to populate those cells. Below part of my code, which needs to be changed.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!