cursor : Java Glossary
home C words local find no local find frame, full screen Google search web for topic jump to footer translate with Babelfish 2008-03-02 by Roedy Green ©1996-2008 Canadian Mind Products
Go to : punctuation 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (all)
cursor
Most commonly the cursor refers to the arrow where the mouse is currently pointing. In contrast the caret marks the insertion point where keyed characters will next be inserted in a block of text. You can change the cursor’s shape with code like this:
// Set up an hour-glass cursor when the cursor is over myComponent.
// You could use any of the predefined Cursors such as
// WAIT_CURSOR, HAND_CURSOR, DEFAULT_CURSOR, MOVE_CURSOR, CROSSHAIR_CURSOR.
// TEXT_CURSOR or the various resize cursors.

import java.awt.Cursor;
//...
myComponent.setCursor( Cursor.getPredefinedCursor ( Cursor.WAIT_CURSOR ) );
Every Component/ Container can have a different cursor so that the cursor automatically changes shape when the user waves the mouse over each Component.

Normally you just select from one of the pre-dedefined cursors, but you can create a custom cursor with Toolkit.createCustomCursor().

createCustomCursor wants an Image. You can create it in the usual way from a *.png or *.gif file, by fishing it out of a resource. You can also create it with the low-level line and bit drawing tools. It won’t take a *.ico, *.ani or *.bmp file directly. You will have to convert them with utility like IconXP.

Cursor is used more generally for anything that marks a place, e.g. you could call the current seek position in a file a cursor, though in recent times, the term is used exclusively for the mouse cursor.

History

The term originally in Latin meant runner, and then was later used for the sliding sight line on a slide rule. From there in computing it came to it meant a marker in a stream, and now to its use for the mouse position marker.

Learning More

Sun’s Javadoc on the Cursor class : available:
Sun’s Javadoc on Toolkit.createCustomCursor : available:

CMP_homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.16] The information on this page is for non-military use only.
You are visitor number 6,339. Military use includes use by defence contractors.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/Mindprod website mirror)
http://mindprod.com/jgloss/cursor.html J:\mindprod\jgloss\cursor.html