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

cut and paste don't work with swing1.1

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.1.6
    • client-libs
    • None

      With the new JFC (swing) graphics libraries, the input field type
      JTextField doesn't accept cut and paste commands under any OS.


      I'm compiling with Sun JDK 1.1.6
      I'm using Swing 1.1beta2
      I've run this with Sun JDK 1.1.6 on Linux, and as an applet with
      Netscape 4.06/Linux and Netscape 4.06/Windows NT.

      All exhibit the problem in the same way.



      Here is a test program that opens a window using AWT (traditional java)
      and a window using JFC (swing/new java). You'll see that you can paste
      into the TextField that comes from AWT, but can't paste into the
      JTextField that comes from swing.

      ------- test1.java:

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

       class test1 {
         public static void main(String[] args) {
           Frame f = new Frame("awt Frame & TextField");
           f.setLayout(new GridLayout(1, 1));
           f.add(new TextField());
           f.setSize(200, 80);
           f.setVisible(true);
           JFrame jf = new JFrame("swing JFrame & JTextField");
           jf.getContentPane().setLayout(new GridLayout(1, 1));
           jf.getContentPane().add(new JTextField());
           jf.setSize(200, 80);
           jf.setVisible(true);
         }
       }

            svioletsunw Scott Violet (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: