Replies: 18 comments 27 replies
-
For me, CTRL+X in Netbeans temporarily restores the broken copy functionality, until it happens again that is. |
Beta Was this translation helpful? Give feedback.
-
Using Netbeans 23 relaxes most of the problems for me. Most of the time a copy / paste does not work, the second try succeeds. So right direction. |
Beta Was this translation helpful? Give feedback.
-
I can confirm the problem on Windows and funny thing is, sometimes it works back again. Maybe a raise condition with smth? |
Beta Was this translation helpful? Give feedback.
-
Netbeans 23 doesn't seem to improve things for me. It still happens a lot. Occasionally if I try CTRL+C twice it may fix it, but not always. |
Beta Was this translation helpful? Give feedback.
-
I can confirm that I’m experiencing this issue as well; it seems to be quite common on Windows. The |
Beta Was this translation helpful? Give feedback.
-
I completely agree with the frustration expressed in this thread. This clipboard issue is not just frustrating but quite basic and critical for daily workflow. It's concerning that such an essential feature is unreliable, as it may force many developers to switch to other IDEs just to avoid the constant interruptions. A fix for this issue is quite important and would make a huge difference for all of us who rely on NetBeans for efficient development. |
Beta Was this translation helpful? Give feedback.
-
I don’t know if this will help but I typically copy/paste between NetBeans, IntelliJ, Notepad++ and VisualCode. This is on windows 11. I tend to switch apps pretty quickly when I’m copy/pasting but I don’t know if that’s relevant. I also have two external monitors attached to my laptop. I can’t help with the code but I’ll see if I can build and run from source. Maybe I can quickly try a patched version. I’ve never built NetBeans but if it might help, I can try. I’ll have to check the policy at work on running a patched version though. |
Beta Was this translation helpful? Give feedback.
-
I think I can always copy from the Debug output window, and paste it into an external application. So is the problem only related to the main file editor? Or was this fact already known and, as always, I missed it? 😆 |
Beta Was this translation helpful? Give feedback.
-
I added a PR to introduce this new retry logic for With this, It is possible that this interference is one reason to break copy and paste in windows, since get and set clipboard could interfere each other. Using this windows hack there always was a Since there seems to be a timing or threading problem, my guess is that the So having these thoughts, making |
Beta Was this translation helpful? Give feedback.
-
Did #8024 make it into Netbeans 24? |
Beta Was this translation helpful? Give feedback.
-
@stodge Not yet. I am running on it for some time now, but the problem occurs still from time to time. However, I have the "feeling" it is much less than without #8024 and the getContents modifcation. But saying this I am aware that there are very different experiences of this problem from different users. |
Beta Was this translation helpful? Give feedback.
-
Thanks, just wanted to confirm. |
Beta Was this translation helpful? Give feedback.
-
Netbeans 24: After pasting breaks, copying is also affected. Instead of copying an empty selection (just the cursor), it copies as if the entire line was selected, even if it is (at least visibly) not. Some strange indexing is going on. |
Beta Was this translation helpful? Give feedback.
-
Any actions here? |
Beta Was this translation helpful? Give feedback.
-
After seeing this on Java's Reddit, I decided to take a look at this (even though I've never used this IDE). I was able to reproduce this issue 100% of the time right from the opening. I've found the root cause and will post a fix once I figure out why this is the case. If one puts a breakpoint here https://github.com/openjdk/jdk/blob/a891630817844c8c42994da3b3110925ca4595a0/src/java.desktop/share/classes/sun/awt/datatransfer/SunClipboard.java#L135 and forcefully sets I added a bit of checking, and indeed, that is what is happening.
Added check in
Edit: I've narrowed down the cause, and this seems to be a bug in the JDK. I'm getting assert failures building AWT with
Local fix on my machine, I haven't been able to reproduce the issue with this change. Running AWT tests |
Beta Was this translation helpful? Give feedback.
-
@xxDark Reading your message I assume you started Netbeans Java in a C++ Debugger. Could you be more specific on that? Did you use Visual Studio and stuff? Or was it enough to simply debug the Netbeans starter exe? |
Beta Was this translation helpful? Give feedback.
-
in version 24 using -J-Dorg.netbeans.NbClipboard.level=FINEST i had very limited problems. I run CopyPasteTest and here are the results` Iteration 1: 2025-02-23 16:07:08.557 - Pasted into Notepad Iteration 2: 2025-02-23 16:07:09.364 - Pasted into NetBeans - Error: Copied or pasted text is empty. Iteration 2: 2025-02-23 16:07:10.284 - Pasted into Notepad Iteration 3: 2025-02-23 16:07:11.077 - Pasted into NetBeans - Error: Copied or pasted text is empty. Iteration 3: 2025-02-23 16:07:11.995 - Pasted into Notepad Iteration 4: 2025-02-23 16:07:12.788 - Pasted into NetBeans - Error: Copied or pasted text is empty. Iteration 4: 2025-02-23 16:07:13.709 - Pasted into Notepad Iteration 5: 2025-02-23 16:07:14.499 - Pasted into NetBeans - Error: Copied or pasted text is empty. Iteration 5: 2025-02-23 16:07:15.478 - Pasted into Notepad Iteration 6: 2025-02-23 16:07:16.268 - Pasted into NetBeans - Error: Copied or pasted text is empty. Iteration 6: 2025-02-23 16:07:17.310 - Pasted into Notepad Iteration 7: 2025-02-23 16:07:18.100 - Pasted into NetBeans - Error: Copied or pasted text is empty. Iteration 7: 2025-02-23 16:07:19.144 - Pasted into Notepad Iteration 8: 2025-02-23 16:07:19.937 - Pasted into NetBeans - Error: Copied or pasted text is empty. Iteration 8: 2025-02-23 16:07:20.981 - Pasted into Notepad Iteration 9: 2025-02-23 16:07:21.774 - Pasted into NetBeans - Error: Copied or pasted text is empty. Iteration 9: 2025-02-23 16:07:22.812 - Pasted into Notepad Iteration 10: 2025-02-23 16:07:23.603 - Pasted into NetBeans - Error: Copied or pasted text is empty. Iteration 10: 2025-02-23 16:07:24.648 - Pasted into Notepad I tried with and without Nothing changed... Any idea suggestions? |
Beta Was this translation helpful? Give feedback.
-
Thinking about the latest findings (@xxDark) I find it strange that the clipboard seems to be not useable using the Java Editor but nearly without any problems from the Output or IDE Log windows. |
Beta Was this translation helpful? Give feedback.
-
Copying text in and out of NetBeans stops working for some users on windows, this thread discusses #3962 on the adventurous quest to fix the bug.
Beta Was this translation helpful? Give feedback.
All reactions