Java examples for Swing:JTextComponent
Setting the Blink Rate of a JTextComponent's Caret
import javax.swing.JTextArea; import javax.swing.text.JTextComponent; public class Main { public static void main(String[] argv) throws Exception { JTextComponent c = new JTextArea(); // Set rate to blink once a second c.getCaret().setBlinkRate(1000);// w w w . j ava 2 s .c o m // Set the caret to stop blinking c.getCaret().setBlinkRate(0); } }