MouseEvent and KeyEvent for JTable in JDialog is not functioning

What is working for a JFrame not working for a JDialog ???
I created a JTable in JDialog and the mouse event is not working in JTable
what I have to do ???
Edited by: amnonm on Apr 25, 2009 3:07 AM

This is what I could send I hope you will understand from this what is my problem.
line 13 ????
public TableRoughGroupDiamondDDetails(Vector Data)
         data = Data;
          addWindowListener(closeWindow);
//                          SET HEADER AND DATABASE TO THE TABLE
          Container contentPane = getContentPane();
          contentPane.setLayout(null);
          tp      = this;
          sp = TableSimularSales(data);
          Enumeration enu = data.elements();
          arcivePanel.setBorder(new BevelBorder(BevelBorder.LOWERED));
          getContentPane().add(arcivePanel);
          JLabel frm = new JLabel(The stone is from arcive, no details !");
          frm.setFont(new Font("Arial", Font.BOLD, 30));
          arcivePanel.add(frm);
          detailsPanel = PanelContainer();
          if(enu.hasMoreElements())
               setChanges((Object[])data.elementAt(0));
               sp.setBounds(0,0,759,245);
          else
               sp.setBounds(0,0,759,436);
          getContentPane().add( sp );
          JPanel p = new JPanel();
        JLabel soldLabel = new JLabel("Sold:");
        JLabel arciveLabel = new JLabel(""Arcive:");
        JLabel stockLabel = new JLabel("In stock:");
        JButton sold = new JButton();
        JButton arcive = new JButton();
          JButton stock = new JButton();
          sold.setBackground(new Color(196,215,255));
          arcive.setBackground(new Color(210,235,221));
          stock.setBackground(new Color(250,178,178));
          sold.setEnabled(false);
          arcive.setEnabled(false);
          stock.setEnabled(false);
          p.setBorder(new BevelBorder(BevelBorder.LOWERED));
          getContentPane().add( p );
          p.setBounds(0,438,759,27);
         setVisible(true);
          tableView.addKeyListener(new KeyAdapter()
               int row_int;
               public void keyPressed(KeyEvent mouseEvent)
                    row_int =tableView.getSelectedRow();
                    if(row_int<0)
                         return;
                    setChanges((Object[])data.elementAt(row_int));
               public void keyReleased(KeyEvent mouseEvent)
                    row_int =tableView.getSelectedRow();
                    if(row_int<0)
                         row_int=0;
                    setChanges((Object[])data.elementAt(row_int));
          tableView.addMouseListener(new MouseAdapter()
               int row_int;
               public void mousePressed(MouseEvent mouseEvent)
                    row_int =tableView.getSelectedRow();
                    if(row_int<0)
                         return;
                    setChanges((Object[])data.elementAt(row_int));
               public void mouseReleased(MouseEvent mouseEvent)
                    row_int =tableView.getSelectedRow();
                    if(row_int<0)
                         row_int=0;
                    setChanges((Object[])data.elementAt(row_int));
     

Similar Messages

  • TS1398 my ipod will not connect to my home wifi, it can see it and asks for a password but will not connect. I have tried it at another location and it will connect to other wifi connections. I have another ipod that is connecting just fine to my home wif

    My ipod will not connect to my home wifi, it can see it and asks for a password but will not connect. I have tried it at another location and it will connect to other wifi connections. I have another ipod that is connecting just fine to my home wifi.

    - Reset the iPod. nothing is lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Power off and then back on your router
    - Reset network settings: Settings>General>Reset>Reset Network Settings
    - iOS: Troubleshooting Wi-Fi networks and connections

  • HT201270 i have just updated my old 3GS and now when i am on restore the window is comming up and asking for a password. i have not set up a password for restore, please help how i can restore my date???

    i have just updated my old 3GS and now when i am on restore the window is comming up and asking for a password. i have not set up a password for restore, please help how i can restore my date???

    capriz wrote:
    i have just updated my old 3GS ...
    To what... iOS 7 is Not supported on the 3 GS

  • The u, j, m and 7 keys on the keyboard are not functioning properly on my macbook air. Please Help!

    The u, j, m and 7 keys on the keyboard are not functioning properly on my macbook air. In its place are a random assortment of keys (Ex - u = "eqrw" or "IOUY"). This randomly happened when logging back in after sleep mode. No liquid damage at all. Please help!

    OK, I fixed the problem by doing a SMC (System Management Controller) reset as follows:
    1. Powered off my MacBook and removed everything connected except for the power chord.
    2. When powered off, I held "Shift" + "ctrl" + "Option" + "Power button" for 5 seconds or so until the little light on the front started to blink rapidly.
    3. Powered up my Mac, which took a little longer than usual to start and tested the "missing" keys which now works perfectly again.
    Just added another couple of years usage with my aging mac :-)

  • GPO is set for "Auto download and notify for install" but it does not work correctly on two of my servers.

    Hello,
    I have a problem with two of my servers. I have ~200 servers which are updating fine through WSUS. The settings are as you can see "3 - Auto download and notify for install" in the GPO.
    This is the correct setting. I want to achieve that I can install the updates whenever I want on these servers. On client computers there is a strict schedule with auto installs.
    My GPO works fine for 98% of my servers. On two servers (a big file server and a TMG server) the settings are made as you can see in the screenshots, but the updates still get installed automatically.
    I have no idea what I'm doing wrong here... It is a big problem for me that updates get installed automatically on these servers.
    Although the Policy and the Registry both say 3 the server behaves like option 4 is active.
    I would be very thankful for any input on how to find out what's the issue here.

    and was not able to find any sign of an admin installing it in the WindowsUpdate.log.
    Then the Windows Update Agent DID NOT install this update, and it's not really a WSUS issue.
    My typical response to such a claim would be to ask you to show me in the WindowsUpdate.log where the update was installed... but it seems that request has already been answered.
    The more relevant question it seems, is HOW DID these updates allegedly get installed?
    Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
    My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

  • GR and GI for the Subcontracting PO are not aligned

    Hello,
    We face an issue were the posting dates of the
    GR(101 mvt) and GI(543mvt) for the Subcontracting PO are not aligned (GR takes
    the posting date as the next day and GI as the current date).
    We did an initial analysis and found that it is
    the user time zone that leads to the different posting date. The user who does
    the GR has a time zone setting of UTC+8 maintained in her user profile.
    Whenever the user does a GR for the Process Order after 18:00CET, system
    proposes the posting date for GR asthe next day. But GI picks the current date.
    As per subcontracting scenario, the GI(goods issue from subcontracting stock)
    happens whenever we do the GR. We understand that time zone has an effect on GR
    posting date but the question is why GI posting date is not affected? Is it a
    standard SAP behaviour?
    Procedure -
    We create the Process order via COR1 transaction,
    In the master recipe we have maintained the control key for the subcontracting
    operation.
    Purchase Requisition will be created from the
    Process Order. This PR is converted to Subcontracting PO via ME21N. The
    delivery and PGI is done
    via ME2O transaction. We have a custom transaction
    to do the GR similar to MIGO transaction.

    Hi Manikumar,
    Empty the Personal time zone for the specific user & test the same. As by default, system time is maintained in UTC time zone.
    Thanks,
    Nihar

  • HT4718 I have OS 10.6 Tiger and I use to have DAshBoard and now for some reason I can not find it to launch it.  Can anyone help me??

    For some reason I can not launch Dash board anymore.  I have used Finder and it is not there.  What can I co besides take computer into service?

    1. It's possible you removed Dashboard from your Dock by mistake. In that case, you can find it in your Applications folder and drag it back to the Dock to create the alias. The entire Dock are aliases.
    2. If you cannot find in your Applications folder you can try re-installing the Combo Update I linked to.
    This is a fuller install, as opposed to an incremental "delta" update so it should overwrite any files that are damaged or missing. It does not matter if you have applied it before.

  • Where is my Firefox Tshirt.I ordered it and paid for it but it has not arrived

    I ordered a Firefox Tshirt and paid for it but I have still not received it

    Try to ask in the Contributors forum.
    *https://support.mozilla.com/forums/contributors

  • Is it possible to get a refund for a game that is not functioning anymore?

    Hi,
    I recently bought a few bonus packs for a game called Valor that is not functioning since this Monday. I tried to contact their support but the only response I received so far was a macro message that in short explains that their servers are offline and they work on the issue. Three days later their status update still gives no ETA when eventually the service will be restored and I'm getting afraid that while waiting for them to fix the issue I might loose my legal right of refund. How can I proceed in that case?
    Regards,
    Martin

    There's no defined time frame for asking for a refund since the iTunes Store has no refund policy; the official statement is that all sales are final. Any request for a refund is on a case-by-case basis and granted as an exception to policy, not a guarantee. I'd suggest waiting a couple more days and see if the problems are corrected by the developer. If not, then go here:
    http://www.apple.com/support/itunes/contact/
    and follow the instructions to report the issue to the iTunes Store. It's possible that they will make an exception for you and grant a refund.
    Regards.

  • Must click then click and drag for JTable Drag and Drop

    Hi All,
    I've been using Java 1.4 to drag and drop data between two tables in our application. Basically I need to drag the data from individual rows of the source table and insert it into one of the cells in the new table. This works absolutely fine and has made a huge improvement to this portion of our app. I've included example source code below that does a similar thing by transferring data from one table and inserting it into another (it's quite big and also not as well done as the example in our real app but unfortunately I can't send the source for that).
    The thing I've noticed though is that in order to start dragging data I need to click to select it and then press and hold the mouse button to start dragging, whereas under W**dows and just about every other OS you can just press and hold and start dragging straight away. If you try this with a JTable though it just changes the rows you have selected so the drag and drop works but feels a bit clunky and amateurish. I'd like to do something about this such that it works like Windows Explorer (or similar) where you can just press the mouse button and start dragging.
    Any help would be greatly appreciated - and if anybody finds the code useful you're more than welcome to it. Note that the business end of this is CustomTransferHandler.java - this will show you how to insert data at a specific position in a JTable, it's a bit of a faff but not too bad once you've got it sussed.
    Thanks,
    Bart Read
    ===============================================================
    TestFrame.java
    * TestFrame.java
    * Created on October 21, 2002, 4:59 PM
    import java.awt.*;
    import java.awt.datatransfer.*;
    import java.awt.dnd.*;
    import java.awt.event.*;
    import java.util.TooManyListenersException;
    import javax.swing.*;
    * @author  readb
    public class TestFrame extends javax.swing.JFrame
         private static final String [] NAMES     = {
              "John", "Geoff", "Madeleine", "Maria", "Flanders",
              "Homer", "Marge", "Bart", "Lisa", "Weird Baby" };
         private JTable source;
         private JTable dest;
         private MyTableModel     sourceModel;
         private MyTableModel     destModel;
         private Clipboard          clipboard;
         /** Creates a new instance of TestFrame */
         public TestFrame()
              clipboard = getToolkit().getSystemClipboard();
              Container c = getContentPane();
              c.setLayout( new BorderLayout( 40, 40 ) );
              source = new MyJTable();
              sourceModel = new MyTableModel();
              source.setModel( sourceModel );
              source.setDragEnabled( true );
              CustomTransferHandler handler = new CustomTransferHandler( "Source handler" );
              source.setTransferHandler( handler );
              try
                   source.getDropTarget().addDropTargetListener( handler );
              catch ( TooManyListenersException tmle )
                   tmle.printStackTrace();
              dest = new MyJTable();
              destModel = new MyTableModel();
              dest.setModel( destModel );
              dest.setDragEnabled( true );
              handler = new CustomTransferHandler( "Dest handler" );
              dest.setTransferHandler( handler );
              try
                   dest.getDropTarget().addDropTargetListener( handler );
              catch ( TooManyListenersException tmle )
                   tmle.printStackTrace();
              c.add( new JScrollPane( source ), BorderLayout.WEST );
              c.add( new JScrollPane( dest ), BorderLayout.EAST );
              populate();
         private void populate( MyTableModel model )
              for ( int index = 0; index < NAMES.length; ++index )
                   model.setRow( index, new DataRow( index + 1, NAMES[ index ] ) );
         private void populate()
              populate( sourceModel );
              populate( destModel );
         public static void main( String [] args )
              TestFrame app = new TestFrame();
              app.addWindowListener(
                   new WindowAdapter() {
                        public void windowClosing( WindowEvent we )
                             System.exit( 0 );
              app.pack();
              app.setSize( 1000, 600 );
              app.show();
         private class MyJTable extends JTable
              public boolean getScrollableTracksViewportHeight()
                   Component parent = getParent();
                   if (parent instanceof JViewport)
                        return parent.getHeight() > getPreferredSize().height;
                   return false;
    }=====================================================================
    MyTableModel.java
    * MyTableModel.java
    * Created on October 21, 2002, 4:43 PM
    import java.util.ArrayList;
    * @author  readb
    public class MyTableModel extends javax.swing.table.AbstractTableModel
         private static final int          NUMBER               = 0;
         private static final int          NAME               = 1;
         private static final String []     COLUMN_HEADINGS     = { "Number", "Name" };
         private ArrayList data;
         /** Creates a new instance of MyTableModel */
         public MyTableModel()
              super();
              data = new ArrayList();
         public int getColumnCount()
              return COLUMN_HEADINGS.length;
         public String getColumnName( int index )
              return COLUMN_HEADINGS[ index ];
         public Class getColumnClass( int index )
              switch ( index )
                   case NUMBER:
                        return Integer.class;
                   case NAME:
                        return String.class;
                   default:
                        throw new IllegalArgumentException( "Illegal column index: " + index );
         public int getRowCount()
              return ( null == data ? 0 : data.size() );
         public Object getValueAt( int row, int column )
              DataRow dataRow = ( DataRow ) data.get( row );
              switch ( column )
                   case NUMBER:
                        return new Integer( dataRow.getNumber() );
                   case NAME:
                        return dataRow.getName();
                   default:
                        throw new IllegalArgumentException( "Illegal column index: " + column );
         public void addRow( DataRow row )
              int rowIndex = data.size();
              data.add( row );
              fireTableRowsInserted( rowIndex, rowIndex );
         public void addRows( DataRow [] rows )
              int firstRow = data.size();
              for ( int index = 0; index < rows.length; ++index )
                   data.add( rows[ index ] );
              fireTableRowsInserted( firstRow, data.size() - 1 );
         public void setRow( int index, DataRow row )
              if ( index == data.size() )
                   data.add( row );
              else
                   data.set( index, row );
              fireTableRowsUpdated( index, index );
         public void insertRows( int index, DataRow [] rows )
              for ( int rowIndex = rows.length - 1; rowIndex >= 0; --rowIndex )
                   data.add( index, rows[ rowIndex ] );
              fireTableRowsInserted( index, index + rows.length - 1 );
         public DataRow getRow( int index )
              return ( DataRow ) data.get( index );
         public DataRow removeRow( int index )
              DataRow retVal = ( DataRow ) data.remove( index );
              fireTableRowsDeleted( index, index );
              return retVal;
         public boolean removeRow( DataRow row )
              int index = data.indexOf( row );
              boolean retVal = data.remove( row );
              fireTableRowsDeleted( index, index );
              return retVal;
         public void removeRows( DataRow [] rows )
              for ( int index = 0; index < rows.length; ++index )
                   data.remove( rows[ index ] );
              fireTableDataChanged();
    }=====================================================================
    DataRow.java
    * DataRow.java
    * Created on October 21, 2002, 4:41 PM
    import java.io.Serializable;
    * @author  readb
    public class DataRow implements Serializable
         private int          number;
         private String     name;
         /** Creates a new instance of DataRow */
         public DataRow( int number, String name )
              this.number = number;
              this.name = name;
         public int getNumber()
              return number;
         public String getName()
              return name;
         public String toString()
              return String.valueOf( number ) + ": " + name;
    }======================================================================
    CustomTransferHandler.java
    * CustomTransferHandler.java
    * Created on October 22, 2002, 8:36 AM
    import java.awt.*;
    import java.awt.datatransfer.Clipboard;
    import java.awt.datatransfer.ClipboardOwner;
    import java.awt.datatransfer.DataFlavor;
    import java.awt.datatransfer.Transferable;
    import java.awt.datatransfer.UnsupportedFlavorException;
    import java.awt.dnd.*;
    import java.awt.event.InputEvent;
    import java.io.IOException;
    import java.util.Arrays;
    import javax.swing.Icon;
    import javax.swing.ImageIcon;
    import javax.swing.JComponent;
    import javax.swing.JTable;
    import javax.swing.TransferHandler;
    * @author  readb
    public class CustomTransferHandler
                   extends TransferHandler
                   implements Transferable, ClipboardOwner, DropTargetListener
         public static final DataFlavor     ROW_ARRAY_FLAVOR     = new DataFlavor( DataRow[].class, "Multiple rows of data" );
         private String               name;
         private ImageIcon          myIcon;
         private     DataRow []          data;
         private boolean               clipboardOwner                    = false;
         private int                    rowIndex                         = -1;
         /** Creates a new instance of CustomTransferHandler */
         public CustomTransferHandler( String name )
              this.name = name;
         public boolean canImport( JComponent comp, DataFlavor [] transferFlavors )
              System.err.println( "CustomTransferHandler::canImport" );
              if ( comp instanceof JTable && ( ( JTable ) comp ).getModel() instanceof MyTableModel )
                   for ( int index = 0; index < transferFlavors.length; ++index )
                        if ( ! transferFlavors[ index ].equals( ROW_ARRAY_FLAVOR ) )
                             return false;
                   return true;
              else
                   return false;
         protected Transferable createTransferable( JComponent c )
              System.err.println( "CustomTransferHandler::createTransferable" );
              if ( ! ( c instanceof JTable ) || ! ( ( ( JTable ) c ).getModel() instanceof MyTableModel ) )
                   return null;
              this.data = null;
              JTable               table     = ( JTable ) c;
              MyTableModel     model     = ( MyTableModel ) table.getModel();
              Clipboard          cb          = table.getToolkit().getSystemClipboard();
              cb.setContents( this, this );
              clipboardOwner = true;
              int [] selectedRows = table.getSelectedRows();
              Arrays.sort( selectedRows );
              data = new DataRow[ selectedRows.length ];
              for ( int index = 0; index < data.length; ++index )
                   data[ index ] = model.getRow( selectedRows[ index ] );
              return this;
         public void exportAsDrag( JComponent comp, InputEvent e, int action )
              super.exportAsDrag( comp, e, action );
              Clipboard          cb          = comp.getToolkit().getSystemClipboard();
              cb.setContents( this, this );
         protected void exportDone( JComponent source, Transferable data, int action )
              System.err.println( "CustomTransferHandler::exportDone" );
              if ( TransferHandler.MOVE == action && source instanceof JTable && ( ( JTable ) source ).getModel() instanceof MyTableModel )
                   JTable table = ( JTable ) source;
                   MyTableModel model = ( MyTableModel ) table.getModel();
                   int [] selected = table.getSelectedRows();
                   for ( int index = selected.length - 1; index >= 0; --index )
                        model.removeRow( selected[ index ] );
         public void exportToClipboard( JComponent comp, Clipboard clip, int action )
              System.err.println( "CustomTransferHandler::exportToClipboard" );
         public int getSourceActions( JComponent c )
              System.err.println( "CustomTransferHandler::getSourceActions" );
              if ( ( c instanceof JTable ) && ( ( JTable ) c ).getModel() instanceof MyTableModel )
                   return MOVE;
              else
                   return NONE;
          *     I've commented this out because it doesn't appear to work in any case.
          *     The image isn't null but as far as I can tell this method is never
          *     invoked.
    //     public Icon getVisualRepresentation( Transferable t )
    //          System.err.println( "CustomTransferHandler::getVisualRepresentation" );
    //          if ( t instanceof CustomTransferHandler )
    //               if ( null == myIcon )
    //                    try
    //                         myIcon = new ImageIcon( getClass().getClassLoader().getResource( "dragimage.gif" ) );
    //                    catch ( Exception e )
    //                         System.err.println( "CustomTransferHandler::getVisualRepresentation: exception loading image" );
    //                         e.printStackTrace();
    //                    if ( null == myIcon )
    //                         System.err.println( "CustomTransferHandler::getVisualRepresentation: myIcon is still NULL" );
    //               return myIcon;
    //          else
    //               return null;
         public boolean importData( JComponent comp, Transferable t )
              System.err.println( "CustomTransferHandler::importData" );
              super.importData( comp, t );
              if ( ! ( comp instanceof JTable ) )
                   return false;
              if ( ! ( ( ( JTable ) comp ).getModel() instanceof MyTableModel ) )
                   return false;
              if ( clipboardOwner )
                   return false;
              if ( !t.isDataFlavorSupported( ROW_ARRAY_FLAVOR ) )
                   return false;
              try
                   data = ( DataRow [] ) t.getTransferData( ROW_ARRAY_FLAVOR );
                   return true;
              catch ( IOException ioe )
                   data = null;
                   return false;
              catch ( UnsupportedFlavorException ufe )
                   data = null;
                   return false;
         public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException
              System.err.println( "MyTransferable::getTransferData" );
              if ( flavor.equals( ROW_ARRAY_FLAVOR ) )
                   return data;
              else
                   throw new UnsupportedFlavorException( flavor );
         public DataFlavor[] getTransferDataFlavors()
              System.err.println( "MyTransferable::getTransferDataFlavors" );
              DataFlavor [] flavors = new DataFlavor[ 1 ];
              flavors[ 0 ] = ROW_ARRAY_FLAVOR;
              return flavors;
         public boolean isDataFlavorSupported( DataFlavor flavor )
              System.err.println( "MyTransferable::isDataFlavorSupported" );
              return flavor.equals( ROW_ARRAY_FLAVOR );
         public void lostOwnership( Clipboard clipboard, Transferable transferable )
              clipboardOwner = false;
         /** Called while a drag operation is ongoing, when the mouse pointer enters
          * the operable part of the drop site for the <code>DropTarget</code>
          * registered with this listener.
          * @param dtde the <code>DropTargetDragEvent</code>
         public void dragEnter(DropTargetDragEvent dtde)
         /** Called while a drag operation is ongoing, when the mouse pointer has
          * exited the operable part of the drop site for the
          * <code>DropTarget</code> registered with this listener.
          * @param dte the <code>DropTargetEvent</code>
         public void dragExit(DropTargetEvent dte)
         /** Called when a drag operation is ongoing, while the mouse pointer is still
          * over the operable part of the drop site for the <code>DropTarget</code>
          * registered with this listener.
          * @param dtde the <code>DropTargetDragEvent</code>
         public void dragOver(DropTargetDragEvent dtde)
         /** Called when the drag operation has terminated with a drop on
          * the operable part of the drop site for the <code>DropTarget</code>
          * registered with this listener.
          * <p>
          * This method is responsible for undertaking
          * the transfer of the data associated with the
          * gesture. The <code>DropTargetDropEvent</code>
          * provides a means to obtain a <code>Transferable</code>
          * object that represents the data object(s) to
          * be transfered.<P>
          * From this method, the <code>DropTargetListener</code>
          * shall accept or reject the drop via the
          * acceptDrop(int dropAction) or rejectDrop() methods of the
          * <code>DropTargetDropEvent</code> parameter.
          * <P>
          * Subsequent to acceptDrop(), but not before,
          * <code>DropTargetDropEvent</code>'s getTransferable()
          * method may be invoked, and data transfer may be
          * performed via the returned <code>Transferable</code>'s
          * getTransferData() method.
          * <P>
          * At the completion of a drop, an implementation
          * of this method is required to signal the success/failure
          * of the drop by passing an appropriate
          * <code>boolean</code> to the <code>DropTargetDropEvent</code>'s
          * dropComplete(boolean success) method.
          * <P>
          * Note: The data transfer should be completed before the call  to the
          * <code>DropTargetDropEvent</code>'s dropComplete(boolean success) method.
          * After that, a call to the getTransferData() method of the
          * <code>Transferable</code> returned by
          * <code>DropTargetDropEvent.getTransferable()</code> is guaranteed to
          * succeed only if the data transfer is local; that is, only if
          * <code>DropTargetDropEvent.isLocalTransfer()</code> returns
          * <code>true</code>. Otherwise, the behavior of the call is
          * implementation-dependent.
          * <P>
          * @param dtde the <code>DropTargetDropEvent</code>
         public void drop(DropTargetDropEvent dtde)
              System.err.println( "CustomTransferHandler::drop" );
              Component c = dtde.getDropTargetContext().getDropTarget().getComponent();
              if ( ! ( c instanceof JComponent ) )
                   dtde.rejectDrop();
                   return;
              JComponent comp = ( JComponent ) c;
              if ( ! ( c instanceof JTable ) || ! ( ( ( JTable ) c ).getModel() instanceof MyTableModel ) )
                   dtde.rejectDrop();
                   return;
              dtde.acceptDrop( TransferHandler.MOVE );
              //     THIS is such a mess -- you can't do the following because
              //     getTransferable() throws an (undocumented) exception - what's that
              //     all about.
    //          Transferable t = dtde.getTransferable();
    //               if ( !t.isDataFlavourSupported( ROW_ARRAY_FLAVOR ) )
    //                    dtde.rejectDrop();
    //                    return false;
    //          TransferHandler handler = comp.getTransferHandler();
    //          if ( null == handler || ! handler.importData( comp, t ) )
    //               dtde.rejectDrop();
    //               return;
              Point p = dtde.getLocation();
              JTable table = ( JTable ) comp;
              rowIndex = table.rowAtPoint( p );
              //     So you have to do this instead and use the data that's been
              //     stored in the data member via import data.  Total mess.
              if ( null == data )
                   dtde.rejectDrop();
                   return;
              MyTableModel model = ( MyTableModel ) table.getModel();
              if ( rowIndex == -1 )
                   model.addRows( data );
              else
                   model.insertRows( rowIndex, data );
              dtde.acceptDrop( TransferHandler.MOVE );
         /** Called if the user has modified
          * the current drop gesture.
          * <P>
          * @param dtde the <code>DropTargetDragEvent</code>
         public void dropActionChanged(DropTargetDragEvent dtde)
    }

    Hi again,
    Well I've tried using the MouseListener / MouseMotionListener approach but it doesn't quite seem to work, although it does get the events correctly. I think the reason is that it doesn't interact correctly with the Java DnD machinery which is something that V.V hinted at. It's something that I may need to look into if / when I have more time available.
    I have to say though that I haven't had any problems with scrollbars - we're making fairly heavy use of large tables and if you drag over a table with a scroll bar and move to the top or bottom then it scrolls as you would expect and allows you to drop the data where you like. For this situation I've used pretty much the same approach as for the toy example above except that I've implemented separate source and destination TransferHandlers (the source table is read-only, and it really doesn't make sense to allow people to drag from the destination table so I've essentially split the functionality of the example handler down the middle).
    I'm not actually particularly in favour of messing too much with the mechanics of DnD, more because of lack of time than anything else. Guess I'll just have to put up with this for the moment. Doesn't help that DnD is so poorly documented by Sun.
    Thanks for all your help.
    Bart

  • How do I locate my ID and password for my One-to-One (not the same as my Apple ID)?

    I have not used my new One-to-One for some time, and apparently failed to record the ID and password. The Apple website asks me for my Apple ID to set up an appointment under One-to-One, which makes no sense because my Apple ID is not recognized by the One-to-One program. I need to change that to my Apple ID, but cannot do that unless I can get onto One-to-One. Any suggestions?

    I have not used my new One-to-One for some time, and apparently failed to record the ID and password. The Apple website asks me for my Apple ID to set up an appointment under One-to-One, which makes no sense because my Apple ID is not recognized by the One-to-One program. I need to change that to my Apple ID, but cannot do that unless I can get onto One-to-One. Any suggestions?

  • HT1577 I PURCHASED MISSION IMPOSSIBLE AND PAYED FOR THE MOVIE BUT HAS NOT DONE LOADED

    I have payed for the download of movie Mission Impossible and have not recieved it. Please return money back to my account.
    Thanks
    Paul Kennedy

    You are not addressing Apple here at all.
    We are all itunes users just like you.
    Click Store>Check for Available Downloads

  • Bought and paid for CS4 Premium, Acrobat Pro not accepting serial #

    My Acrobat Pro application, part of the CS4 Design Premium, will not accept the same serial I used for my other Adobe applications.
    Any solutions beyond tossing two hours of my life in a phone call to Adobe India Customer Service? I have had one good experience using Adobe CS out of five, but really it takes hours to get someone who is helpful. Adobe needs to address this brutal customer in need situation.
    Apple buys Adobe, everything is fixed.
    Solutions? Beyond waiting for Jobs to mount a take over?

    I should add, I did install the complete CS4 Design Premium package in mid November 09. Worked flawlessly, until yesterday that is.
    After some hours on the phone with Adobe customer service in India, finally the serial question was solved for all applications BUT Acrobat Pro. The tech said the serial number issue was caused by unknown forces. Odd, Adobe has a special number for serials not being accepted. It is a 1-800 number, I used it. I believe it is an Adobe made issue to keep pirated software out of the loop.
    The tech said he would call me back in thirty minutes to confirm all applications were in perfect working order. I played with the entire group and AP was the dog of the bunch.
    The tech never called back to check on me. That was nearly 24 hours ago. I anticipated this would be the poor result from Adobe.
    I suspect I will need to devote another hour or so in Adobe Hell India Zone for a fix. The customer service is something which turns me off all Adobe products. When I find replacements for the software I will jump at the chance.

  • Installing new IOS7 and prompt for passcode when I have not set one up for my iphone

    Have installed iOS7 on my iphone 4S and when it has restarted it has asked me to enter my passcode, when I had not previously entered one and now phone is locked and I am unable to use the device. Is their a default passcode that I have to enter before selecting one of own?
    Please advise.

    Try and force your iPad into Recovery Mode
    1. Disconnect the USB cable from the device, but leave the other end of the cable connected to your computer's USB port.
    2. Turn off the device: Press and hold the Sleep/Wake button for a few seconds until the red slider appears, then slide the slider. Wait for the device to turn off.
    3.While pressing and holding the Home button, reconnect the USB cable to the device. The device should turn on.
    4. Continue holding the Home button until you see the "Connect to iTunes" screen. When this screen appears, release the Home button. iTunes should alert you that it has detected a device in recovery mode. Click OK, and then click Restore to restore the device.
    Note: Data will be lost.

  • HT201209 I have downloaded and paid for  an app that is not working.  It has no sound.

    I have paid for and downloaded a book app - for my grade 2 students to use.  It downloaded fine, but has no sound.  It is "Go away, Big Green Monster' by Ed Emberley - I have deleted and downloaded it several times - but it still has no sound?  What do I do to fix this problem or get my money back?
    My next question is that I have bought and put in an itunes card to use on my ipad - but when I buy an app the ipad is still using my credit card and is not redeeming my itunes gift card - what to I do so that my gift card is used rather than my credit card?

    If you open the App Store and go to Updates (on the bottom) and then Purchased (near the top), you will see your app there and you can download it again.

Maybe you are looking for

  • How to change Availability check (MTVFP) in sales order

    Hi, is it possible to change the Availability check on an material in an sales order? Some material have the value KP (no check) of Availability check in table MARC. If we use this material in sales orders somtimes we want change the Availability che

  • Adding Search help to a field of standard transction

    hi experts, i m new to abap. my pp consultant wants that in transaction MM03, for the field on selection screen (Material) one more search help should be added. and on pressing f4 it should be displayed there with other search options. The search fie

  • What is data Class ?

    Hi. I need to know what is "data class". I am aplying a hot package in SAP, and it generated a error because el data class USR34 not exists associated with cdhdr table. The note says that I must create it, but I don´t know how I must to do it. And  I

  • Rfc error while opening query designer

    installed sap gui 7.20 on my system to access sap ecc or BI. now my issue is while opening bex query designer of BI. it prompts me Error Group RFC_ERROR_PROGRAM Message Ent please suggest me what actions to be taken

  • Making a single play list

    lets say i have 5 play lists in itunes, how do i get all the play lists into one. what im trying to avoid is mutlipul play lists on my ipod. any help would be great thanx