惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
G
Google Developers Blog
Spread Privacy
Spread Privacy
I
InfoQ
V
V2EX
S
Schneier on Security
小众软件
小众软件
C
CERT Recently Published Vulnerability Notes
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Stack Overflow Blog
Stack Overflow Blog
T
Threat Research - Cisco Blogs
L
Lohrmann on Cybersecurity
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Attack and Defense Labs
Attack and Defense Labs
云风的 BLOG
云风的 BLOG
The Hacker News
The Hacker News
S
SegmentFault 最新的问题
C
Cybersecurity and Infrastructure Security Agency CISA
NISL@THU
NISL@THU
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
Latest news
Latest news
S
Secure Thoughts
Project Zero
Project Zero
MongoDB | Blog
MongoDB | Blog
I
Intezer
Security Latest
Security Latest
Apple Machine Learning Research
Apple Machine Learning Research
Vercel News
Vercel News
N
Netflix TechBlog - Medium
V2EX - 技术
V2EX - 技术
量子位
T
Threatpost
T
The Blog of Author Tim Ferriss
Y
Y Combinator Blog
T
Tor Project blog
A
Arctic Wolf
Microsoft Security Blog
Microsoft Security Blog
T
The Exploit Database - CXSecurity.com
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Check Point Blog
博客园 - Franky
Google DeepMind News
Google DeepMind News
The Register - Security
The Register - Security
The GitHub Blog
The GitHub Blog
L
LINUX DO - 热门话题

博客园 - tatung zhang

全屏显示问题 sun发布lwuit1.4 深入理解 LWUIT 框架的 MVC lwuit控件关系模式图,Padding和Margin关系图 eclipse rcp 获取工程项目路径 eclipse content assist 代码提示功能失效解决办法 LWUIT 1.3 发布了 Eclipse RCP中添加第三方jar包的办法 lwuit---调整滚动条灵敏度值 lwuit---更改字体大小 j2me获取手机IMEI保证软件信息安全解决方案 show一下最新项目的界面图 谈谈移动开发 lwuit ---一些细节疑难杂症整理笔记 lwuit-tab与list配合使用 lwuit-List控件使用 lwuit控件布局定位 VS2005创建智能设备项目失败 wince嵌入式应用程序开发环境搭建
lwuit-list 困扰我的列颜色改变
tatung zhang · 2009-07-08 · via 博客园 - tatung zhang

所做的项目,有多个地方需要根据属性值改变list列的颜色,困扰了半天终于搞定了。

public Component getListCellRendererComponent(List list, Object value,
                
int index, boolean isSelected) {
            MailInfo mailinfo 
= (MailInfo) value;
            title.setText(mailinfo.getTitle());
            sender.setText(mailinfo.getSender());
            
if (mailinfo.getimportantflag().equals("重要")) {
                title.getStyle().setFgColor(
0xFF0000);
                sender.getStyle().setFgColor(
0xFF0000);

            }
 else {
                title.getStyle().setFgColor(
0xFFFFFF);
                sender.getStyle().setFgColor(
0xFFFFFF);
            }

            pic.setIcon(mailinfo.getPic());
            
return this;
        }

一定要加else否则变成默认的颜色。

posted on 2009-07-08 16:33  tatung zhang  阅读(645)  评论(1)    收藏  举报

刷新页面返回顶部