PasteAction.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:incubator-netbeans 作者:
public void actionPerformed(ActionEvent ev) {
    try {
        Transferable trans = t.paste();
        Clipboard clipboard = getClipboard();

        if (trans != null) {
            ClipboardOwner owner = (trans instanceof ClipboardOwner) ? (ClipboardOwner) trans
                                                                     : new StringSelection(""); // NOI18N
            clipboard.setContents(trans, owner);
        }
    } catch (UserCancelException exc) {
        // ignore - user just pressed cancel in some dialog....
    } catch (IOException e) {
        Exceptions.printStackTrace(e);
    } finally {
        EventQueue.invokeLater(this);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号