首页>代码>Java开发邮件接收发送系统源代码下载>/javamail2.0/javamail2.0_src/src/frame/CellRender.java
package frame;

import java.awt.Component;

import javax.swing.Icon;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;

//自定义组建渲染方式(插入附件的时候用到)
class CellRender extends JLabel implements ListCellRenderer {
	private Icon icon = null;

	public CellRender(Icon icon) {
		this.icon = icon;
	}

	public Component getListCellRendererComponent(JList list, Object value,
			int index, boolean isSelected, boolean cellHasFocus) {
		setText(String.valueOf(value));
		setIcon(icon);
		setOpaque(true);
		setBackground(isSelected ? list.getSelectionBackground() : list
				.getBackground());
		setForeground(isSelected ? list.getSelectionForeground() : list
				.getForeground());
		return this;
	}
}
最近下载更多
annazhang  LV29 2023年4月7日
微信网友_6191697646571520  LV6 2022年11月24日
伊不归  LV6 2022年4月20日
1029162867  LV13 2021年12月25日
Aoifee  LV4 2021年11月11日
linhe27  LV7 2021年3月20日
ming_123_9715  LV23 2021年3月6日
85489354756a  LV3 2021年3月6日
gaohd123456789  LV8 2020年12月5日
aataibao  LV1 2020年8月16日
最近浏览更多
gao123456789  LV6 2月7日
Wky123456 2023年11月2日
暂无贡献等级
hbsoft2008  LV16 2023年10月19日
EFWAGGFAWGR 2023年10月19日
暂无贡献等级
2036495585  LV9 2023年9月26日
qiqi123456  LV1 2023年9月21日
LongTory  LV2 2023年6月6日
dmyafda  LV5 2023年3月26日
Tuxxxxx  LV3 2023年1月3日
微信网友_6191697646571520  LV6 2022年11月24日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友