/** * The Excel Adapter is constructed with a * JTable on which it enables Copy-Paste and acts * as a Clipboard listener. */ public ExcelAdapter(atcControls.atcGridSource myJTable, string calculatorType) { jTable1 = myJTable; KeyStroke copy = KeyStroke.getKeyStroke(KeyEvent.VK_C, ActionEvent.CTRL_MASK, false); // Identifying the copy KeyStroke user can modify this // to copy on some other Key combination. KeyStroke paste = KeyStroke.getKeyStroke(KeyEvent.VK_V, ActionEvent.CTRL_MASK, false); // Identifying the Paste KeyStroke user can modify this //to copy on some other Key combination. jTable1.registerKeyboardAction(this, "Copy", copy, JComponent.WHEN_FOCUSED); jTable1.registerKeyboardAction(this, "Paste", paste, JComponent.WHEN_FOCUSED); // system = Toolkit.getDefaultToolkit().getSystemClipboard(); this.calculatorType = calculatorType; }
/** * @param myJTable */ public FtableAdapter(atcControls.atcGridSource myJTable, string calculatorType) { base(myJTable, calculatorType); }
public void setJTable(atcControls.atcGridSource jTable1) { this.jTable1 = jTable1; }