Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Re: JList customized with TreeSet (http://www.velocityreviews.com/forums/t125957-re-jlist-customized-with-treeset.html)

Sandip Chitale 08-23-2003 09:44 PM

Re: JList customized with TreeSet
 
You need to look into:

Look at the example at the top of JList javadoc. Specifically look at the
MyCellRenderer example:

http://java.sun.com/j2se/1.4.2/docs/...ing/JList.html

also see

http://java.sun.com/docs/books/tutor...ents/list.html

"Oni" <felixdraganca@yahoo.ca> wrote in message news:6aa7f171.0308231317.2beeba5e@posting.google.c om...
> Hi there!
>
> I have a TreeSet of TreeSets which I need to display in a JList
> (preferably).
> The elements of the TreeSets are Strings.
> I need to display the JList with TreeSet.size() cells and in every
> cell I want to have the representation of the every TreeSet by
> drawing a rectangle(filled with different color) for every element of
> the current TreeSet.
> In addition, I would like to print the Strings on top of this
> rectangles and the selection event for the list as well.
>
> I am trying to sort this out with DefaultListModel and
> ListCellRenderer, but I really don't know exactly how to use them to
> get the desired outcome.
>
> I am not necessarly sticked to JList, but I want this visual
> representation with rectangles in a scrollpane anyway.
>
>
> I would really appreciate a lot any idea, suggestions or even pieces
> of code.
> Many thanks in advance.





All times are GMT. The time now is 04:19 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.