void (AWTEvent event) { if (event instanceof FocusEvent focusEvent) { Component fromComponent = focusEvent.getComponent(); Component oppositeComponent = focusEvent.getOppositeComponent(); paintFocusBorders(true); switch (event.getID()) { case FocusEvent.FOCUS_GAINED: myCurrent = fromComponent; myPrevious = oppositeComponent; myTemporary = focusEvent.isTemporary(); break; case FocusEvent.FOCUS_LOST: myTemporary = focusEvent.isTemporary(); default: break; } Util.drawOnActiveFrameGraphics(g -> { g.setColor(myApplicationState.getColor()); g.fillOval(5,5, 10, 10); g.setColor(JBColor.black); g.setStroke(new BasicStroke(2)); g.drawOval(5,5, 10, 10); g.setColor(myApplicationState.getColor()); g.fillOval(5,5, 10, 10); }); } }