• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

removeAllHighlights() not working

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic