Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Swing / AWT / SWT and the fly likes Cursor color of JTextfield Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Cursor color of JTextfield" Watch "Cursor color of JTextfield" New topic
Author

Cursor color of JTextfield

Hugo Anbeek
Greenhorn

Joined: Dec 03, 2008
Posts: 2
Hi,

In a program I wrote I set the background color of a textfield to black and the foreground color to white. However the cursor remains black is it possible to set the color of the cursor?

Thnx.

Hugo
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
textField.setCaretColor(Color.WHITE);
Hugo Anbeek
Greenhorn

Joined: Dec 03, 2008
Posts: 2
gracias (i feel stupid lol)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Cursor color of JTextfield
 
Similar Threads
need to make the text cursor white in a black text editor
Is Ruby easier to learn than Java, since there appears to be less code to write?
Input Textfield Background Color When the Cursor Is There
File Organization
custom cursor in XOR mode