Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Remus Stratulat
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!