public void txtComponentFocusGained(FocusEvent e) { target = (JTextComponent) e.getSource(); if (!(e.getOppositeComponent() instanceof AbstractButton)) { // Sonst blinkt das die ganze Zeit bei der Eingabe final Timeline timeline1 = new Timeline(target); timeline1.addPropertyToInterpolate("background", target.getBackground(), Color.red); timeline1.setDuration(140); timeline1.playLoop(2, Timeline.RepeatBehavior.REVERSE); // Tools.flash(target, 2); } target.selectAll(); }