1 2 3 Previous Next 34 Replies Latest reply: Apr 27, 2011 4:36 PM by 858180 RSS

    Copy & Paste Function in Java JDK 6 Update 24

    846470
      I have a problem, that in my Version Java JDK 6 Update 24 the Copy & Paste-Function do not work. I have already read that they had disabled this function in Update 24 and in Update 23 it is still working.

      But when comes Java 6 Update 25?
      And is in Update 25 this function enabled or not?
      Or on which way can i put Update 24 working with the Copy & Paste- Function?

      Regards
        • 1. Re: Copy & Paste Function in Java JDK 6 Update 24
          gimbal2
          843467 wrote:
          But when comes Java 6 Update 25?
          Dude, why don't you try typing "java update 25" into Google and see what you get. Go on, give it a try just for kicks. It would have been far less effort than making this post.

          Or perhaps you were under the illusion that people from Oracle visit here to answer your questions?
          • 2. Re: Copy & Paste Function in Java JDK 6 Update 24
            abillconsl
            What specifically do you mean that you can't copy or paste?
            • 3. Re: Copy & Paste Function in Java JDK 6 Update 24
              846470
              sorry that I havn't been precise enough.

              We have a Java client application using Swing running on windows xp or windows 7 and since update 24 our users can no longer use copy and paste to transfer data from other applications (for instance e-mail clients or excel) into Swing components of our Java application or the other way round from Swing components (for instance JTextField or JTable) into the other applications.

              In the release notes I read about security vulnerabilities having been fixed with update 24. So I don't really know if this behaviour is a feature or a bug?

              If it's not a bug, how can we disable this feature?

              Thx in advance

              Edited by: 843467 on Mar 15, 2011 8:10 PM
              • 4. Re: Copy & Paste Function in Java JDK 6 Update 24
                abillconsl
                So if you have a JTextArea called textArea, and you do textArea.copy() and textArea.paste(), it does not work?!

                Did you check into java.awt.datatransfer.Clipboard? I never have, but you might want to.

                ~Bill
                • 5. Re: Copy & Paste Function in Java JDK 6 Update 24
                  846470
                  Thanks for your answer. I will check with the Clipboard object.

                  But the problem does only occur when I try to transfer data out of the java app into another app. In the past users could simply mark some contents in the java app, press ctrl-c which caused the contents to be transfered to the system clipboard and then paste the data somewhere else, or the other way round. This worked fine without doing any additional coding.

                  Now since update 24 it seems that swing does no longer allow data to be transfered from the java app through the system clipboard. If this is a new feature, how can we configure to allow this again?

                  Thx for your help
                  • 6. Re: Copy & Paste Function in Java JDK 6 Update 24
                    abillconsl
                    843467 wrote:
                    Thanks for your answer. I will check with the Clipboard object.

                    But the problem does only occur when I try to transfer data out of the java app into another app. In the past users could simply mark some contents in the java app, press ctrl-c which caused the contents to be transfered to the system clipboard and then paste the data somewhere else, or the other way round. This worked fine without doing any additional coding.

                    Now since update 24 it seems that swing does no longer allow data to be transfered from the java app through the system clipboard. If this is a new feature, how can we configure to allow this again?

                    Thx for your help
                    I should have been more clear. My apology. Here's what I really should have said ... "If I understand you correctly, that's really weird and will generally be unacceptable, IMO. But for clarification, can you try to use the copy and paste methods and see if that helps, as they are supposed to work directly on the System clipboard." Then of course I directed your attention to the Clipboard class for information's sake.

                    Also, has anyone else noticed this and is it peculiar to any particular OP-SYS?
                    • 7. Re: Copy & Paste Function in Java JDK 6 Update 24
                      793415
                      abillconsl wrote:
                      ..has anyone else noticed this and is it peculiar to any particular OP-SYS?
                      Here is a place you can test it. I am running 1.6.0_24 (Sun/Win 7) and copy/paste by keyboard shortcuts fails for me.
                      • 8. Re: Copy & Paste Function in Java JDK 6 Update 24
                        Darryl Burke
                        Moderator action: Moved from Java Programming.

                        db
                        • 9. Re: Copy & Paste Function in Java JDK 6 Update 24
                          846470
                          I tested again (on WinXP SP3 platform) and discovered that copy/paste by keyboard shortcut is working when I run the app inside my Eclipse IDE.
                          If I start the app with Java Web Start then copy/paste fails again. So I assume that it has something to do with the app being downloaded.

                          Hope this helps.
                          • 10. Re: Copy & Paste Function in Java JDK 6 Update 24
                            splungebob
                            843467 wrote:
                            I tested again (on WinXP SP3 platform) and discovered that copy/paste by keyboard shortcut is working when I run the app inside my Eclipse IDE.
                            If I start the app with Java Web Start then copy/paste fails again. So I assume that it has something to do with the app being downloaded.
                            Did you try the keyboard alternatives to Ctrl-X, Ctrl-C, and Ctrl-V? Namely:
                            Cut: Shift-Delete
                            Copy: Ctrl-Insert
                            Paste: Shift-Insert
                            • 11. Re: Copy & Paste Function in Java JDK 6 Update 24
                              abillconsl
                              Andrew Thompson wrote:
                              abillconsl wrote:
                              ..has anyone else noticed this and is it peculiar to any particular OP-SYS?
                              Here is a place you can test it. I am running 1.6.0_24 (Sun/Win 7) and copy/paste by keyboard shortcuts fails for me.
                              Well that sounds really stinkalog. I certainly hope they fix it!

                              PS: Nice site - thanks.

                              Edited by: abillconsl on Mar 16, 2011 4:28 PM
                              • 12. Re: Copy & Paste Function in Java JDK 6 Update 24
                                793415
                                abillconsl wrote:
                                Andrew Thompson wrote:
                                abillconsl wrote:
                                ..has anyone else noticed this and is it peculiar to any particular OP-SYS?
                                Here is a place you can test it. I am running 1.6.0_24 (Sun/Win 7) and copy/paste by keyboard shortcuts fails for me.
                                Well that sounds really stinkalog. I certainly hope they fix it!
                                *
                                PS: Nice site - thanks.
                                Thanks. I like to help out where I can. :-)

                                BTW @splungebob Tried the alternate key-combinations you suggested with no success. Both styles of keyboard shortcut work (for copy at least) in a JTable in an app. that runs from naked Jar file (no security manager).

                                * That suggests it was a deliberate change to the security policy for sand-boxed apps., and will not be changed back.

                                OTOH - since JWS existed for free floating apps. (1.2+), and since 1.6.0_10+ for embedded applets, the JNLP API services can be used to do copy/paste operations even in a sand-boxed app. Specifically the ClipboardService. Here is my little demo. of the ClipboardService.

                                Ultimately it seems a good move to update sand-boxed apps. to leverage the JNLP API services for any case where the keyboard accelerators fail. I'll need to update the properties applet, and several other apps. (when I get a round tuit).
                                • 13. Re: Copy & Paste Function in Java JDK 6 Update 24
                                  Kleopatra
                                  Just to throw in something: here's a link to a blog explaining the vulnerability that was fixed (not that I fully understand it, but you certainly do :-)

                                  http://slightlyrandombrokenthoughts.blogspot.com/2011/03/oracle-java-applet-clipboard-injection.html

                                  Cheers
                                  Jeanette
                                  • 14. Re: Copy & Paste Function in Java JDK 6 Update 24
                                    Kleopatra
                                    wtf - since when do links not work? Plus an edit doesn't show the complete post ...

                                    so trying again, without any tags - soft should be good enough to auto-detect, anyway, this is good ol' jive, right ;)

                                    http://slightlyrandombrokenthoughts.blogspot.com/2011/03/oracle-java-applet-clipboard-injection.html

                                    Jeanette
                                    1 2 3 Previous Next