Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4177800

CopyAction & CutAction don't work anymore!!!

XMLWordPrintable



      Name: dm26566 Date: 09/30/98


      This is a 1.1.7 regression on Win95 only.
      this program seems to work fine on the Solaris JSW version of 1.1.6 and 1.1.7, with Swing 1.0.3 and Swing 1.1b3.
      it also works fine on Windows NT 4.0 using 1.1.6 and 1.1.7 with Swing 1.0.3 and Swing 1.1b3.
      it also works fine on Win95 using 1.1.6 with Swing 1.0.3 or Swing 1.1b3.
      it FAILS on Win95 using 1.1.7 with Swing 1.0.3 or Swing 1.1b3.

      The copyAction (CTRL-C) of the JTextPane (i dont
      know about the other textField/Area ect)
      Doesnt work anymore with JDK1.1.7
      Also the cutAction (CTRL-X) makes the text dissappear
      but it doesnt set the text in the clipboard.

      the CTRL-V (pastAction) seems to work
      if i copy a text from the notebook of windows
      and try to paste this then it works.

      As far as i can see. The text doesnt get copied
      in the clipboard anymore!

      Anyone knows a workaround?
      If i cant find one i cant use this JDK!

      nojit makes no difference


      even if i really add the actions to the TextPane:

          if ( ((String) actions[i].getValue(Action.NAME)).equals(DefaultEditorKit.copyAction) )
          {
          k = KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.Event.CTRL_MASK );
          keymap.addActionForKeyStroke(k, actions[i]);
         } else if ( ((String) actions[i].getValue(Action.NAME)).equals(DefaultEditorKit.pasteAction) )
         {
          k = KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.Event.CTRL_MASK );
          keymap.addActionForKeyStroke(k, actions[i]);
         } else if ( ((String) actions[i].getValue(Action.NAME)).equals(DefaultEditorKit.cutAction) )
         {
          k = KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.Event.CTRL_MASK );
          keymap.addActionForKeyStroke(k, actions[i]);
         }

      it still doesnt work!
      It works in JDK1.1.6!


      import java.awt.*;
      import com.sun.java.swing.*;

      public class CopyCutTest extends JFrame {
        public CopyCutTest() {
            getContentPane().setLayout(new BorderLayout());
            getContentPane().add(""Center"" , new JTextArea());
            pack();
        }

        public static void main(String[] args) {
            new CopyCutTest().show();
        }
      }


      Greetings
      Johan Compagner
      (Review ID: 39610)
      ======================================================================

            tprinzing Tim Prinzing (Inactive)
            dmcduffisunw Dale Mcduffie (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: