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

removeAllHighlights() not working  RSS feed

 
Willy Ray
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can ADD highlights to a JTextArea all day. I'm reading annotation data out of the database, and creating Annotation instances... then I'm using those to create highlights on my JTextArea at the relevant indices.



The problem is when I go to delete an annotation. The following code is an inner class that implements ActionListener and is added to my delete button.



Anybody got any thoughts?

/willy
 
Willy Ray
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
erm... never mind.

My model code was the problem.

I forgot to close the connection in the delete method in the annotationDAO. Then I was going back to the DB for the loadAnnotations() method right after that. So, it turns out, I was removing all the highlights, then redrawing them all back out from the database... then, sometime LATER, my delete connection was committing.

I'm a little mad at myself... ... but I've definitely learned something.

/w
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!