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

Caret is echoed when scrolling in a full JTextField

XMLWordPrintable

    • merlin
    • generic, x86
    • generic, windows_nt



      Name: skT88420 Date: 01/05/2000


      F:\JAVA\jdk1.2.2\bin>java -version
      java version "1.2.2"
      Classic VM (build JDK-1.2.2-W, native threads, symcjit)

      Type more chars than can fit in a JTextField and then scroll back, when the
      cursor moves far enough to cause the view to scroll an echo of the caret is
      left in the middle of the field. Run the sample code below, type enough chars
      to over-fill the field and then scroll back and eventually you will see the
      echoed caret.

      If the look and feel is not forced to be windows the echo of the caret is at
      the far left or right of the field depending on which way you are scrolling.

      public class VerticalBar// extends JPanel
      {
        //main for debug and general testing.
        public static void main(String[] args)
        {
          try {UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}
          catch(Exception exc) {System.err.println("Error loading L&F: " + exc);}

          JTextField testField = new JTextField("wwwwwwwwwwwww");

          JDialog frame = new JDialog();
          frame.getContentPane().add(testField);
          frame.pack();
          frame.setVisible(true);
          frame.addWindowListener(new WindowAdapter()
          {
           public void windowClosing(WindowEvent e)
           {
             System.exit(1);
           }
          });
        }
      }
      (Review ID: 99615)
      ======================================================================

            svioletsunw Scott Violet (Inactive)
            skonchad Sandeep Konchady
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: