Add superscript in messageBox

Hi all,

I'm trying to add superscript in my messageBox. JOptionPane.showMessageDialog(mainFrame,"Error on "+(i+1)+"th line");

Depending on which line error occurs, I need to say like: 1st, 2nd, 3rd and so on. I just need to figure out how to append "st"/"nd" as superscript. Any help?

Thanks in advance.

[379 byte] By [SMHasana] at [2007-11-27 2:08:52]
# 1
You can use HTML:JOptionPane.showMessageDialog(null, "<html>Error on " + (i + 1) + "<sup>th</sup> line</html>");
Torgila at 2007-7-12 1:58:40 > top of Java-index,Desktop,Core GUI APIs...