After writing a console application (For mundane I/O tasks not worth mentioning here), I decided I needed to make the text multicolored for readability. I would’ve liked to keep it in a command prompt, being inexperienced with Swing, but as far as I could figure there was no way to do that, I looked around the Swing API and can’t find anything.
Ideally, I’d be able to use something like
for(int i=0; i<aString.length(); i++){
if(aString.charAt(i) == '?'){
String pre = aString.substring(0,i);
String post = aString.substring(i);
aString = pre + red("?") + post; //As you can see by red("?"), I have no idea what I'm doing
}
}
so that I could just loop through the text I would have previously printed, insert the coloring information, and display it.
Can anyone point me in the right direction? Method, class, snippet, anything?
You might get some ideas from Message Console.