Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

reinstating DnD on saved object  RSS feed

Alan Shiers
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I'm trying to figure out how to reinstate functionality of serialized saved objects when I open a saved file. I make use of Drag 'n Drop in my application. Several instances of an object that is getting saved is a class I named TargetPanel which extends JPanel implements Serializable and in its constructor it calls a method called installDnD().

installDnD() and associated inner class TargetPanelContainerListener are as follows:

When I open a saved file, I wound up manually iterating over every instance of the TargetPanel(s) and calling installDnD() on each one in order to reinstate each TargetPanel as being a viable drop target for transferable components. Is this usual? Wouldn't this functionality be saved. I shouldn't have to do that should I?

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!