A “cursor” is used to indicate a mouse cursor that is not blinking.
So, I assume that you are talking about a carriage that is used in a text component:
textField.setCaretColor(...);
Edit:
The above sentence does this for a single text field. To change it for all text fields, you should use the following at the beginning of your program:
UIManager.put("TextField.caretForeground", new ColorUIResource(...));