wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Thinlet Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Thinlet Question" Watch "Thinlet Question" New topic
Author

Thinlet Question

Sundar Ram
Ranch Hand

Joined: May 22, 2006
Posts: 102
Hi,

Iam using Thinlet in my project. Iam using list(A list allows the user to select one or more objects from a list). Iam creating an empty list initially, and adding items to the list dynamically. So i wanted to colour each list item dynamically at runtime. Each list item needs to have a different color depending on certain conditions. So, how to clolor each item in a list dynamically??

Kindly help,

-Sundar


SCJP 5.0 | SCWCD 1.4
http://heysundar.blogspot.com
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41065
    
  43
Hello Sundar-

Welcome to JavaRanch.

On your way in you may have missed that JavaRanch has a policy on display names, and yours does not comply with it; specifically, a first name and a last name are required. Please adjust it accordingly, which you can do right here. Thanks for your prompt attention to this matter.

As to your question, AWT itself does not support this (and neither does Swing), so Thinlet can't add that behavior.


Ping & DNS - my free Android networking tools app
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

All you have to do is write a ListCellRenderer that does the coloring you need. There's information in the JList API Doc and the Java Tutorial Swing trail


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41065
    
  43
I stand corrected regarding Swing. But Thinlet uses AWT, so it's still not going to work.
Sundar Ram
Ranch Hand

Joined: May 22, 2006
Posts: 102
Originally posted by Ulf Dittmer:
Hello Sundar-

Welcome to JavaRanch.

On your way in you may have missed that JavaRanch has a policy on display names, and yours does not comply with it; specifically, a first name and a last name are required. Please adjust it accordingly, which you can do right here. Thanks for your prompt attention to this matter.

As to your question, AWT itself does not support this (and neither does Swing), so Thinlet can't add that behavior.


Hello Ulf Dittmer,
I was not aware of the javaranch naming policy before. Thanks for prompting me. Now ive changed it. And also thanks for the reply.
Sundar Ram
Ranch Hand

Joined: May 22, 2006
Posts: 102
Ulf Dittmer,

We can change the list items color in thinlet. But it has to be specified in the XUL file(foreground attribute of item element) which we create for the interface. But this should be done at design time i.e when we write the code. But i require to change the foreground/background color dynamically at runtime.

-Sundar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Thinlet Question
 
Similar Threads
AJAX in JSF
Problem Refreshing a JSP within itself.........
Max number of items in a listbox?
How do i RELOAD a page within itself....
Getting highest ArrayListValue