• 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

Two problems with JTextPane: undo and dnd. :confused:

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
my problems are like this:
- I have a custom DefaultStyledDocument put it into a JTextPane. When I made a replace the UndoManager gets two events added remove and add. In DocumentFilter I see that replace is not treated like an atomic operation but in fact is just a call of the others operations: remove() and insert(). How can I make replace to be an atomic operation, at least as the UndoManager is concerned?
- the same component is accepting drop from a DnDTree placed nearby. How can I make it not to accept the drop? In the hierarchy of JTextPane I don't see anything that can help me.
Any help will be very appreciated. Thanks!
Remus Stratulat
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic