Possible Duplicate:
Multi-line tooltips in Java?
It is very strange. All I wish to do is make my tool tip multi-lined. I have added the "\n" character to the string I am passing at appropriate places. In fact, I print out that same string, and it does have the line breaks. However, the tooltip does not. Here is what I do:
@Override
public void itemStateChanged(ItemEvent arg0) {
if(arg0.getStateChange() == ItemEvent.SELECTED){
String s = arg0.getItem().toString();
for(InfoContainer i: mc.myInfo)
if(s.equals(i.getId())){
selector.setToolTipText(i.getInfo());
System.out.println(i.getInfo());
return;
}
}
}
However, the tooltip does NOT have the carriage returns, while the System printout DOES.
How about using: "<html>" + firstLine + "<br>" + secondLine + "</html>"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With