Reputation: 59
public void itemStateChanged(ItemEvent e)
{
text += "Language : ";
text += "Hindi: " + Hindi.getState();
text += " English: " + English.getState();
text += "Maths: " + Maths.getState();
label.setText("");
label.setText(text);
}
this code show new result with previous one i want updated result only not the previous one so how can i remove previous AWT label output from the frame.
Upvotes: 0
Views: 60
Reputation: 1208
just remove the + in the first line of the method.
text = "Language : ";
Please note that the way you are appending Strings is not efficient. Try using String.format() instead.
Upvotes: 2