Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我让 JTextArea 显示文本但不编辑它时。它会变成蓝色,看不清楚。不可编辑时如何更改 JTextArea 的颜色?
你不能用
public void setDisabledTextColor(Color c)
?
尝试使用这个:
JTextArea a = new JTextArea("test"); a.setEnabled(false); a.setDisabledTextColor(Color.red);