Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2005

Tip: Looking for answers? Try searching our database.

How can i reorder rows in a Jtable using DnD?

Thread view: 
farseer - 28 Jun 2005 04:47 GMT
There are plenty of discussion on drag and drop on the news net, but
not many that give an example of how to implement re-ordering of JTable
rows using drag & drop.  Could someone point me to a quick overview of
the moving parts that must be taken into account when trying to
implement drag and drop (i.e. what sort of listeners do i need to
implement and where do i need to do this?)

Also, i am suing JDK 1.5.  are there any new features/functions added
that make the implementation of drag and drop simpler perhaps?

thanks much
farseer - 28 Jun 2005 20:03 GMT
i guess this is alot more difficult than i thought.  Maybe we can start
with just the "dragging".
I can get simple dragging to occur by
  -calling JTable.setDragEnabled(true),
  -creating a TransferHandler and assigning it to JTable
(JTable.setTransferHandler)

With that, i can click on a row, then click it again and while holding
the left mouse down, drag it.  What i see is a "folder"  icon being
dragged.  BUT, what i want to see is the ENTIRE row being picked up and
dragged.  How would i go about doing this?

Do i have to now get into implementing DragGestureListener,
DragSourceListener and DropTargetListener, or can i still do it using
just the TransferHandler?
If I need to implement these "Drag" Interfaces, what methods do i need
to be concerned with if i want show a different icon when dragging (
how would implement so that when a user drags, the entire row is
dragged (visibly, you see the entire row picked up and dragged)).

any suggestions would be appreciated


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.