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

DefaultCaret.focusGained does not reactivate caret if editable false

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 1.2.2
    • client-libs



      Name: vi73552 Date: 06/21/99


      <Code in workaround>

      I noticed this on a JTextField, if the textfield isn't editable
      the caret shouldn't be hidden, otherwise selecting text in the
      textfield isn't possible using only the keyboard.

      For what I know the caret should be hidden only if the component
      isn't enabled!

      I send you a test app to demonstrate the behaviour and a PATCH for
      the DefaultCaret class.

      Now the problem may seem less important, but it is critical to me.
      We use data bound fields, and they switch the editable state
      automatically, in some circomstances it's possible that the text
      field switches to editable false and a dialog box appears, after
      closing the dialog box the textfield switchs to editable true but
      the caret doesn't reappear. To solve this problem you should check
      on editable true if the caret is activated!

      My patch doesn't care about it, because the caret will stay activated,
      but I would have to do it on setEnabled(true).

      Thanks
        Patrick
      (Review ID: 84588)
      ======================================================================

            tprinzing Tim Prinzing (Inactive)
            vasya Vassili Igouchkine (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: