Skip to content
Advertisement

Tag: clipboard

Java clipboard is not shared with system

I have an JEditorPane field formatted as HTML and when I’m copying it to clipboard the system is losing all the line breaks. Text inside JEditorPane : When copying with Ctrl + C and paste it in Notepad++ the text is: So, I’ve intercepted the Ctrl+C: And I’ve tried do modify it: but the text inside clipboard is not changing.

Why show java.lang.ClassCastException: android.text.SpannableString cannot be cast to java.lang.String?

When copying String from any browser page, pasteData works properly. However when copying SpannedString from a message sent item editor(field), the application crashes and shows this error message: My code: where the ClipboardManager instance defined as clipBoard, below: All I’m trying to do is use pasteData in String format. How to get rid of this error? Any help is appreciated.

Advertisement