i would like to alternate my font color. the code that i have right now changes all of the text. how can i get it so that it will only update one line color at a time, rather than the whole text area font?
Code:private void sendTextActionPerformed(java.awt.event.ActionEvent evt) {
String temp = input.getText() + "\n";
if (toggleUser.getSelectedItem().equals("User 1")) {
update1.setForeground(Color.red);
update1.append(temp);
} else if (toggleUser.getSelectedItem().equals("User 2")) {
update1.setForeground(Color.BLUE);
update1.append(temp);
}
}
