if (selectedComponent instanceof JTextField) ((JTextField)selectedComponent).cut();
if (selectedComponent instanceof JTextComponent) ((JTextComponent)selectedComponent).cut();
    private void copyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_copyActionPerformed        if (selectedComponent == null)            return;                if (selectedComponent instanceof JTextField)            ((JTextField)selectedComponent).cut();        else if (selectedComponent instanceof JList) {            StringSelection path = new StringSelection(buildSelectPath((JList)selectedComponent));            Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();            cb.setContents(path, path);        }            }//GEN-LAST:event_copyActionPerformed