• 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

Help please with drag and drop

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone, I apologize if I am not making things the right way, although I registered a long time ago this is my first post at this forum. I have a little problem here, it work almost perfect except that when I drag from bottom to top it does not do it. I put print lines and it says that it 's doing everything correctly. If you may wonder why I am doing it this way when I could be using new StringSelection(), the the reason is because I am planing to extend Vector class to create a class Row and put info in it, so when I drag I drag the whole row, because my Row class will contain Components and Objects.
Thanks in advance for your help!!!

 
Marshal
Posts: 28264
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for providing a short, simple, compilable example. When I run it, I find that you can't drop a row anywhere above where you are dragging it from, but you can drop it anywhere below where you are dragging it from.

All I can say is, bear in mind that when you call insertRow and deleteRow, you renumber all of the rows below the point where you inserted or deleted. You also potentially change the numbers of the selected rows.
 
Think of how dumb the average person is. Mathematically, half of them are EVEN DUMBER. Smart tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic