Reference: http://undocumentedmatlab.com/blog/changing-matlab-command-window-colors/
Code:
import com.mathworks.mde.cmdwin.CmdWinDocument.getInstance;
cmdWinDoc = com.mathworks.mde.cmdwin.CmdWinDocument.getInstance;
listeners = cmdWinDoc.getDocmentListeners;
for ii = 1:length(listeners)
if ~isempty(regexp(char(listeners(ii).toString()),'JTextArea'))
jTextArea = listeners(ii);
break;
end
end
jTextArea.setBackground(java.awt.Color.yellow);
jTextArea.setBackground(java.awt.Color(1,1,0));
set(jTextArea,'Background',[1,1,0]);
set(jTextArea,'Foreground',[0,1,1]);
No comments:
Post a Comment