static A makeUneditableWithTextColor(A a, Color color) { if (a != null) swing { a.setEditable(false); // prevent auto-scrolling when text is changed programmatically DefaultCaret caret = cast a.getCaret(); caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE); a.setDisabledTextColor(color); } ret a; } static A makeUneditableWithTextColor(Color color, A a) { ret makeUneditableWithTextColor(a, color); }