Skip to main content

formatted Text in a JList

No replies
wtd_nielsen
Offline
Joined: 2008-10-27

Hi. I want to add formatted Strings to my JList, like this:
ArrayList list = new ArrayList();

String s = String.format("Name:%s\tPrice:%f\t",Hat,54);
list.add(s);

JList jList = new JList(listliste.toArray());
......

But JList just ignores \t and prints Name:HatPrice:54

is there anyway to solve this?