void (int cursor) { if (this.cursor != cursor) { this.cursor = cursor; // do not update cursor every time JTextComponent component = getComponent(); if (component != null) component.setCursor(Cursor.getPredefinedCursor(cursor)); } }