@Override
	public void install( JTextComponent c ) {
		// get caret info if switched theme
		long[] ci = (long[]) c.getClientProperty( KEY_CARET_INFO );
		if( ci != null ) {
			c.putClientProperty( KEY_CARET_INFO, null );

			// if caret info is too old assume that switched from FlatLaf
			// to another Laf and back to FlatLaf
			if( System.currentTimeMillis() - 500 > ci[3] )
				ci = null;
		}
		if( ci != null ) {
			// when switching theme, it is necessary to set blink rate before
			// invoking super.install() otherwise the caret does not blink
			setBlinkRate( (int) ci[2] );
		}

		inInstall = true;
		try {
			super.install( c );
		} finally {
			inInstall = false;
		}

		if( ci != null ) {
			// restore selection
			select( (int) ci[1], (int) ci[0] );

			if( ci[4] != 0 )
				wasFocused = true;

			// if text component is focused, then caret and selection are visible,
			// but when switching theme, the component does not yet have
			// a highlighter and the selection is not painted
			// --> make selection temporary invisible later, then the caret
			//     adds selection highlights to the text component highlighter
			if( isSelectionVisible() ) {
				EventQueue.invokeLater( () -> {
					if( getComponent() == null )
						return; // was deinstalled

					if( isSelectionVisible() ) {
						setSelectionVisible( false );
						setSelectionVisible( true );
					}
				} );
			}
		}
	}
Caret that can select all text on focus gained.
Also fixes Swing's double-click-and-drag behavior so that dragging after
a double-click extends selection by whole words.

@author Karl Tauber
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCaret.java