Module org.jpo

Class JTableCopyPasteClipboardAdapter

java.lang.Object
org.jpo.gui.swing.JTableCopyPasteClipboardAdapter
All Implemented Interfaces:
ActionListener, EventListener

public class JTableCopyPasteClipboardAdapter extends Object implements ActionListener
JTableCopyPasteClipboardAdapter enables Copy-Paste Clipboard functionality on JTables. The clipboard data format used by the adapter is compatible with the clipboard format used by Excel. This provides for clipboard interoperability between enabled JTables and Excel.
See Also:
  • Constructor Details

    • JTableCopyPasteClipboardAdapter

      public JTableCopyPasteClipboardAdapter(JTable myJTable)
      The Excel Adapter is constructed with a JTable on which it enables Copy-Paste and acts as a Clipboard listener.
      Parameters:
      myJTable - table
  • Method Details

    • getJTable

      public JTable getJTable()
      Public Accessor methods for the Table on which this adapter acts.
      Returns:
      the JTable
    • setJTable

      public void setJTable(JTable jTable1)
      Sets the Jtable
      Parameters:
      jTable1 - the jtable
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      This method is activated on the Keystrokes we are listening to in this implementation. Here it listens for Copy and Paste ActionCommands. Selections comprising non-adjacent cells result in invalid selection and then copy action cannot be performed. Paste is done by aligning the upper left corner of the selection with the 1st element in the current selection of the JTable.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      event - event