• 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

Dragging between tabs

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Ruby Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 28193
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
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.
reply
    Bookmark Topic Watch Topic
  • New Topic