• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

A Bit Of A Puzzle

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm puzzled right now as to what to do, maybe some of you Java dieties can help me.
Basically, I have an auction system ( application, not applet ) for a popular game. Players can auction items. Right now, you can pick a category and it displays all the auctions from the category. It does this by sending the server a message. The server then queries the MySQL database and sends back a list of auctions. They are all added to the jList.
What I want to do is improve on the listing of auctions to create icons for each list item signifying different things, such as a locked auction. I can get the info on the server-side, no problem, but actually listing them is what puzzles me.
Now, I could use a ListCellRenderer, but I before I start I want to be sure of exactly how I want to tackle it. I'm a bit confused as to how to make the renderer. In the example I have seen, it adds a row for each item in an array. It looks all fine and dandy, but does that kill the purpose of adding rows manually? Furthermore, would it repaint itself every time I got a new list from the server?
Any replies are appreciated.
// :: Peyton
 
Peyton McCullough
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I overcame my stubborness to try it without seeing if my thoughts were correct - and it worked!
For those of you searching through the threads in this forum a year or two from now - ListCellRenderers still work with manual additition of list items.
Heh, I should have tried it before posting, but I didn't want to write anything I didn't have to. Sorry.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic