java - create new lines in jlist -


code:

string key = stockno.gettext(); string quantitytxt = quantity.gettext(); string info = "\n\nname: " + stockdata.getname(key) +                  "\nprice: £" + (stockdata.getprice(key)) +                  "\nnumber in stock: " + stockdata.getquantity(key) +                 "\nnumber buy: " + quantitytxt; information.append(info); 

out put in jlist, put \n dont seem work

key:33nametshirtprice: £10.00number in stock:37number buy:1 key:55nameshirtprice: £5.00number in stock:12number buy:1 

how as,

key:33 name: tshirt                 (image go here) price: £10 number in stock: 37 number bought 1 

ect 1 element in list

(sorry cant put images due rep)


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -