• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Dragging between tabs  RSS feed

 
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
 
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.
 
Sheriff
Posts: 21423
94
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
 
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.
 
Sheriff
Posts: 23640
48
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!