This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 227226 - can't copy/paste swing components if kde's klipper is running
Summary: can't copy/paste swing components if kde's klipper is running
Status: REOPENED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-09 02:42 UTC by rpelting
Modified: 2017-08-04 19:34 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE Log File (74.40 KB, text/plain)
2013-03-15 12:47 UTC, rpelting
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rpelting 2013-03-09 02:42:12 UTC
swing components cannot be pasted because the paste action in the menu is always disabled.

Steps to reproduce:
1. create a new JPanel
2. add a JLabel
3. Copy the JLabel
4. Now I want to paste the JLabel, but the "Paste" action in the context menu is disabled.

You can use the "Duplicate" function to make a copy, but this only works within
the same JPanel.
It is not possible to copy/paste a swing component to another JPanel this way.
Comment 1 Tomas Pavek 2013-03-11 18:39:13 UTC
It works for me. In fact I don't see a reason why Paste action should be disabled, unless there is some general problem with the clipboard. Are you able to reproduce it? Does the Paste action works anywhere else in the IDE (copying files of projects, or text in the editor)? Anything problems reported in the log file (menu View | IDE Log File)? If you can still reproduce the problem please attach here the log file (includes detailed system information).
Comment 2 OOMicha 2013-03-15 12:26:36 UTC
Same problem as reported by @rpelting.

While working with GUI-Editor/Navigator, you can copy components (copy menu is active) but a following paste action is inactive, in this form as well as in other forms. Similar via copy/paste-Keys C-c/C-v .
Comment 3 rpelting 2013-03-15 12:44:54 UTC
(In reply to comment #1)
> It works for me. In fact I don't see a reason why Paste action should be
> disabled, unless there is some general problem with the clipboard. Are you able
> to reproduce it? 

Yes, it is reproducable.

> Does the Paste action works anywhere else in the IDE (copying
> files of projects, or text in the editor)? 

Copy&Paste works fine in the TextArea (eg Java Editor).

> Anything problems reported in the
> log file (menu View | IDE Log File)? 

No, there are no problem reports in the IDE Log File.


> If you can still reproduce the problem
> please attach here the log file (includes detailed system information).

I have tried it with 

$ java -version
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

and

java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01, mixed mode)

In netbeans-7.2 the paste works fine.
Comment 4 rpelting 2013-03-15 12:47:26 UTC
Created attachment 132643 [details]
IDE Log File
Comment 5 rpelting 2013-03-18 10:38:38 UTC
It seems that the new feature "Edit" > "Paste from History" has problems
with the KDE clipboard manager "Klipper".

If Klipper is running, and there is at least one element on the clipboard,
then "paste" is always disabled in the gui editor.

If Klipper is not running, then "paste" in the gui editor works fine.

Environment:
openSUSE 12.2 (x86_64)
Klipper Version v0.9.7
KDE 4.8.5 (4.8.5) "release 2"
Comment 6 Milutin Kristofic 2013-03-19 11:50:09 UTC
Can you try a recent dev build? There have been a big change in paste history.
Comment 7 rpelting 2013-03-19 22:14:57 UTC
(In reply to comment #6)
> Can you try a recent dev build? There have been a big change in paste history.

Tested with NetBeans IDE Build 201303182300: Bug still exists.
Comment 8 Milutin Kristofic 2013-04-10 15:53:36 UTC
I made a following test - I removed paste from history from current dev version and I couldn't copy either from JPanel with Klipper. There is no connection with paste from history feature and this bug.

Returning back to guibuilder. It could be changes in NbClipboard (Bug #220997, Bug #218370, Bug #218447)
Comment 9 Tomas Pavek 2013-04-10 16:33:34 UTC
To understand it more, can you try to copy something else in the IDE that is not a text?

>> Does the Paste action works anywhere else in the IDE (copying
>> files of projects, or text in the editor)? 
>
> Copy&Paste works fine in the TextArea (eg Java Editor).

E.g. try to copy a file and paste it into a package. Thanks.

I don't see how GUI builder could directly interact with Klipper. Reassigning to platform. I can't test it myself at this moment to find where the cause really is, but this used to work in NB 7.2 and there were significant changes in NbClipboard in 7.3 that might be related.
Comment 10 Stanislav Aubrecht 2013-12-09 15:52:16 UTC
Reporter, please try copy/pasting a file in the IDE as suggested in comment #9 and reopen, thanks.
Comment 11 gugrim 2016-05-05 10:05:49 UTC
Copying files work fine. The problem seems to be with GUI components only. Also, the Duplicate action is disabled. With KDE 4 you could get around it by quitting Klipper but with Plasma 5 it is not easy to get rid of its clipboard plasmoid, which makes this a serious problem for us KDE users.
Comment 12 gugrim 2016-05-05 10:26:55 UTC
Workaround on Plasma 5:

1) Open a Konsole window as root
2) cd /usr/share/plasma/plasmoids
3) mv org.kde.plasma.clipboard/ /root/
4) killall plasmashell
5) Quit the Konsole
6) Alt+F2 plasmashell

The clipboard plasmoid is gone but will probably return when you install a plasma update so you have to do the above again. Of course you no longer have the good stuff that the clipboard plasmoid provides. You can use klipper (Alt+F2 klipper) which can be quit and easily restarted.
Comment 13 gugrim 2016-05-06 07:35:39 UTC
Wrote a slightly more comprehensive article about the Workaround:

http://www.grim.se/guide/nb-guicopy-kde
Comment 14 tux1000 2017-08-04 07:15:53 UTC
Hi,
I think I found a better Workaround.
In the preferences deactivate the option to prevent an empty clipboard (in german: Leere Zwischenablage vermeiden). After this, I can copy&paste swing components in the gui builder under kde 5.
Best regards