Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

Remus Stratulat
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
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!