## Uses of Interface
javax.swing.text.Caret

- Packages that use Caret
  Package | Description
  --- | ---
  javax.swing.plaf.basic | Provides user interface objects built according to the Basic look and feel.
  javax.swing.text | Provides classes and interfaces that deal with editable and noneditable text components.

- - ### Uses of Caret in javax.swing.plaf.basic

    Classes in javax.swing.plaf.basic that implement Caret
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `BasicTextUI.BasicCaret`

    Methods in javax.swing.plaf.basic that return Caret
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected Caret` | BasicTextUI.`createCaret()` Creates the object to use for a caret.

  - ### Uses of Caret in javax.swing.text

    Classes in javax.swing.text that implement Caret
    Modifier and Type | Class | Description
    --- | --- | ---
    `class` | `DefaultCaret` A default implementation of Caret.

    Methods in javax.swing.text that return Caret
    Modifier and Type | Method | Description
    --- | --- | ---
    `Caret` | DefaultEditorKit.`createCaret()` Fetches a caret that can navigate through views produced by the associated ViewFactory.
    `abstract Caret` | EditorKit.`createCaret()` Fetches a caret that can navigate through views produced by the associated ViewFactory.
    `abstract Caret` | NavigationFilter.FilterBypass.`getCaret()` Returns the Caret that is changing.
    `Caret` | JTextComponent.`getCaret()` Fetches the caret that allows text-oriented navigation over the view.

    Methods in javax.swing.text with parameters of type Caret
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | JTextComponent.`setCaret(Caret c)` Sets the caret to be used.

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.