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

JTextField cursor does not blink after scroll

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 11, 15, 17, 18, 19, 20, 21
    • client-libs

      Test Scenario : Check whether user is able to enter text into JTextField and Text cursor blinks
      Expected behavior : User is able to enter the text and user is able to see the text cursor moves towards right by blinking.
      Actual behavior : User is able to enter the text and user is able to see the text moves toward right and once the the text scroll right , text cursor stops to blink.

      I have attached a screen recording of the same.

      ============= Test case =============

      import java.lang.reflect.InvocationTargetException;
      import javax.swing.JFrame;
      import javax.swing.JTextField;
      import javax.swing.SwingUtilities;

      public class JTextFieldCursorNotBlinking {

          private static JFrame frame;

          public static void createTestUI() {
              frame = new JFrame("JTextField Cursor Not Blinking");
              JTextField jTextField = new JTextField(10);

              frame.getContentPane().add(jTextField);
              frame.pack();
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
          }

          public static void main(String[] args) throws InterruptedException,
                  InvocationTargetException {
              try {
                  SwingUtilities.invokeAndWait( () -> createTestUI());
              } finally {
                  /*SwingUtilities.invokeAndWait( () -> {
                      if ( frame != null) {
                          frame.dispose();
                      }
                  });*/
              }
          }
      }

      =======================================

      Tested on MacOS Ventura 13.2.1

            honkar Harshitha Onkar
            landrews Lawrence Andrews
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: