S
S
stas09092021-06-24 15:30:45
Java
stas0909, 2021-06-24 15:30:45

How to make a string of any color JAVA?

I am new to programming. dug all over Google, how to set a color for a line (I want red) and then write this line into a JTextArea. here is part of my code:
String str25 ="";

List result6001 = new ArrayList(list25);
result6001.removeAll(array25);
List result6002 = new ArrayList(array25);
result6002.removeAll(list25);

str25 += ("\n" + "\n" + no.obl25 + " " + ur.url25 + "\n" + " Assignments: " + result6001 + "\n" + " Values: " + result6002);
String string ="";
String string1 = "";
if (result6001.
else string1 = "More changes per day";
jtextarea.apped(str25);

I want to change the color of str25 in the if. I will be grateful for any tips or references to literature

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Roo, 2021-06-24
@xez

Something like this:
https://stackoverflow.com/a/9652143

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question