| Package | Description | 
|---|---|
| java.awt | Contains all of the classes for creating user
interfaces and for painting graphics and images. | 
| java.awt.dnd | Drag and Drop is a direct manipulation gesture found in many Graphical
User Interface systems that provides a mechanism to transfer
information between two entities logically associated with presentation
elements in the GUI. | 
| javax.accessibility | Defines a contract between user-interface components and an assistive technology
that provides access to those components. | 
| javax.swing | Provides a set of "lightweight"
(all-Java language) components that,
to the maximum degree possible, work the same on all platforms. | 
| javax.swing.table | Provides classes and interfaces for dealing with
 javax.swing.JTable. | 
| javax.swing.text.html | Provides the class  HTMLEditorKitand supporting classes
for creating HTML text editors. | 
| Modifier and Type | Field | Description | 
|---|---|---|
| protected static Cursor[] | Cursor. predefinedDeprecated. 
 As of JDK version 1.7, the  getPredefinedCursor(int)method should be used instead. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| Cursor | Toolkit. createCustomCursor(Image cursor,
                  Point hotSpot,
                  String name)Creates a new custom cursor object. | |
| Cursor | List.AccessibleAWTList.AccessibleAWTListChild. getCursor()Get the Cursor of this object. | |
| Cursor | MenuComponent.AccessibleAWTMenuComponent. getCursor()Gets the  Cursorof this object. | |
| Cursor | Component. getCursor()Gets the cursor set in the component. | |
| Cursor | Component.AccessibleAWTComponent. getCursor()Gets the  Cursorof this object. | |
| static Cursor | Cursor. getDefaultCursor()Return the system default cursor. | |
| static Cursor | Cursor. getPredefinedCursor(int type)Returns a cursor object with the specified predefined type. | |
| static Cursor | Cursor. getSystemCustomCursor(String name)Returns a system-specific custom cursor object matching the
 specified name. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| void | List.AccessibleAWTList.AccessibleAWTListChild. setCursor(Cursor cursor)Set the Cursor of this object. | |
| void | MenuComponent.AccessibleAWTMenuComponent. setCursor(Cursor cursor)Sets the  Cursorof this object. | |
| void | Component. setCursor(Cursor cursor)Sets the cursor image to the specified cursor. | |
| void | Component.AccessibleAWTComponent. setCursor(Cursor cursor)Sets the  Cursorof this object. | |
| void | Window. setCursor(Cursor cursor)Set the cursor image to a specified cursor. | 
| Modifier and Type | Field | Description | 
|---|---|---|
| static Cursor | DragSource. DefaultCopyDropThe default  Cursorto use with a copy operation indicating
 that a drop is currently allowed. | |
| static Cursor | DragSource. DefaultCopyNoDropThe default  Cursorto use with a copy operation indicating
 that a drop is currently not allowed. | |
| static Cursor | DragSource. DefaultLinkDropThe default  Cursorto use with a link operation indicating
 that a drop is currently allowed. | |
| static Cursor | DragSource. DefaultLinkNoDropThe default  Cursorto use with a link operation indicating
 that a drop is currently not allowed. | |
| static Cursor | DragSource. DefaultMoveDropThe default  Cursorto use with a move operation indicating
 that a drop is currently allowed. | |
| static Cursor | DragSource. DefaultMoveNoDropThe default  Cursorto use with a move operation indicating
 that a drop is currently not allowed. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| Cursor | DragSourceContext. getCursor()Returns the current drag  Cursor. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| protected DragSourceContext | DragSource. createDragSourceContext(java.awt.dnd.peer.DragSourceContextPeer dscp,
                       DragGestureEvent dgl,
                       Cursor dragCursor,
                       Image dragImage,
                       Point imageOffset,
                       Transferable t,
                       DragSourceListener dsl)Creates the  DragSourceContextto handle the current drag
 operation. | |
| void | DragSourceContext. setCursor(Cursor c)Sets the cursor for this drag operation to the specified
  Cursor. | |
| void | DragGestureEvent. startDrag(Cursor dragCursor,
         Image dragImage,
         Point imageOffset,
         Transferable transferable,
         DragSourceListener dsl)Start the drag given the initial  Cursorto display,
 a dragImage, the offset of
 theImage,
 theTransferableobject, and
 theDragSourceListenerto use. | |
| void | DragGestureEvent. startDrag(Cursor dragCursor,
         Transferable transferable)Starts the drag operation given the  Cursorfor this drag
 operation and theTransferablerepresenting the source data
 for this drag operation. | |
| void | DragGestureEvent. startDrag(Cursor dragCursor,
         Transferable transferable,
         DragSourceListener dsl)Starts the drag given the initial  Cursorto display,
 theTransferableobject,
 and theDragSourceListenerto use. | |
| void | DragSource. startDrag(DragGestureEvent trigger,
         Cursor dragCursor,
         Image dragImage,
         Point dragOffset,
         Transferable transferable,
         DragSourceListener dsl)Start a drag, given the  DragGestureEventthat initiated the drag, the initialCursorto use,
 theImageto drag,
 the offset of theImageorigin
 from the hotspot of theCursorat the instant of the trigger,
 the subject data of the drag, and
 theDragSourceListener. | |
| void | DragSource. startDrag(DragGestureEvent trigger,
         Cursor dragCursor,
         Image dragImage,
         Point imageOffset,
         Transferable transferable,
         DragSourceListener dsl,
         FlavorMap flavorMap)Start a drag, given the  DragGestureEventthat initiated the drag, the initialCursorto use,
 theImageto drag,
 the offset of theImageorigin
 from the hotspot of theCursorat
 the instant of the trigger,
 theTransferablesubject data
 of the drag, theDragSourceListener,
 and theFlavorMap. | |
| void | DragSource. startDrag(DragGestureEvent trigger,
         Cursor dragCursor,
         Transferable transferable,
         DragSourceListener dsl)Start a drag, given the  DragGestureEventthat initiated the drag, the initialCursorto
 use,
 theTransferablesubject data
 of the drag, and theDragSourceListener. | |
| void | DragSource. startDrag(DragGestureEvent trigger,
         Cursor dragCursor,
         Transferable transferable,
         DragSourceListener dsl,
         FlavorMap flavorMap)Start a drag, given the  DragGestureEventthat initiated the drag, the initialCursorto use,
 theTransferablesubject data
 of the drag, theDragSourceListener,
 and theFlavorMap. | 
| Constructor | Description | 
|---|---|
| DragSourceContext(java.awt.dnd.peer.DragSourceContextPeer dscp,
                 DragGestureEvent trigger,
                 Cursor dragCursor,
                 Image dragImage,
                 Point offset,
                 Transferable t,
                 DragSourceListener dsl)Called from  DragSource, this constructor creates a newDragSourceContextgiven theDragSourceContextPeerfor this Drag, theDragGestureEventthat triggered the Drag, the initialCursorto use for the Drag, an (optional)Imageto display while the Drag is taking place, the offset
 of theImageorigin from the hotspot at the instant of the
 triggering event, theTransferablesubject data, and theDragSourceListenerto use during the Drag and Drop
 operation. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| Cursor | AccessibleComponent. getCursor()Gets the Cursor of this object. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| void | AccessibleComponent. setCursor(Cursor cursor)Sets the Cursor of this object. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| Cursor | JTree.AccessibleJTree.AccessibleJTreeNode. getCursor() | |
| Cursor | JTable.AccessibleJTable.AccessibleJTableCell. getCursor()Gets the  Cursorof this object. | |
| Cursor | JList.AccessibleJList.AccessibleJListChild. getCursor() | |
| Cursor | JInternalFrame. getLastCursor()Returns the last  Cursorthat was set by thesetCursormethod that is not a resizableCursor. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| void | JTree.AccessibleJTree.AccessibleJTreeNode. setCursor(Cursor c) | |
| void | JInternalFrame. setCursor(Cursor cursor)Sets the cursor image to the specified cursor. | |
| void | JTable.AccessibleJTable.AccessibleJTableCell. setCursor(Cursor c)Sets the  Cursorof this object. | |
| void | JList.AccessibleJList.AccessibleJListChild. setCursor(Cursor c) | 
| Modifier and Type | Method | Description | 
|---|---|---|
| Cursor | JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry. getCursor() | 
| Modifier and Type | Method | Description | 
|---|---|---|
| void | JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry. setCursor(Cursor c) | 
| Modifier and Type | Method | Description | 
|---|---|---|
| Cursor | HTMLEditorKit. getDefaultCursor()Returns the default cursor. | |
| Cursor | HTMLEditorKit. getLinkCursor()Returns the cursor to use over hyper links. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| void | HTMLEditorKit. setDefaultCursor(Cursor cursor)Sets the default cursor. | |
| void | HTMLEditorKit. setLinkCursor(Cursor cursor)Sets the cursor to use over links. | 
 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, 2025, Oracle and/or its affiliates.  All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.