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

Dragging between tabs

 
David Irwin
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,

I'm currently using DnD to drag items from a JTable and place them in another container. What I'd like to be able to do is now DnD between different JTables that are placed on different tabs of a JTabbedPane. Unfortunately when I try to drag from one table on tab #1 to another table on tab #2 I'm unable to select tab #2 while I'm dragging. I figure there's got to be an easy way to implement this but can't fine anything.

Any ideas?

Thanks,
Dave
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, this is going to be zero help to solving your problem, however, I have to say that the feature you are attempting to implement seems like horrible UXP. I realize you may have no control over that but if you do, I'd recommend not dragging items from tab to tab. Visually, it makes no sense. Ok, move along. Nothing to see here.
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gregg Bolinger wrote:UXP

Please use real words

For those not familiar with the acronym (like me!): http://acronyms.thefreedictionary.com/UXP
 
Pierre Sugar
Ranch Hand
Posts: 62
Java Ruby Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Listen on MouseMoved events on your JTabbedPane.

You can retrieve the tabs index with


You should probably start a timer for a period of time before changing the tab selection.
 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have tabs as such, but on the left side I have a list of available pages and on the right side I have a panel which displays the current page only. So when I drag from the current page, I hover over the list entry on the left side and that does something to cause it to become the current page. Then I can continue to drag to what's now the current page and drop there.

I can't give you details because my code isn't here, but it wasn't difficult to cause a "hover" event to affect the component underneath it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!