• 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:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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: 21463
97
Chrome Eclipse IDE Java Spring Ubuntu VI Editor 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: 23866
50
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!