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

drag and drop with Jlist (weird)  RSS feed

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,

I have 2 lists (A & B) where you can drag items from one another.
The problem is (and this is wierd) that if there is no item on B, you cannot drag anything from A to B.

If there's somthing on B, and you want to move an item from A to B, you first have to drag an item from B to A and only then drag an item from A to B.

WHY?
does anyone have any idea?



list = new JList(model);list.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
list.setTransferHandler(arrayListHandler);
list.setDragEnabled(true);
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!