📄 companylistcellrenderer.java
字号:
package net.robin.crm.ui;
import java.awt.Component;
import javax.swing.DefaultListCellRenderer;
import javax.swing.ImageIcon;
import javax.swing.JList;
public class CompanyListCellRenderer extends DefaultListCellRenderer {
private ImageIcon companyIcon;
public CompanyListCellRenderer() {
super();
}
public Component getListCellRendererComponent(
JList list,
Object value,
int index,
boolean isSelected,
boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected,
cellHasFocus);
if(companyIcon!=null)
setIcon(companyIcon);
return this;
}
public ImageIcon getCompanyIcon() {
return companyIcon;
}
public void setCompanyIcon(ImageIcon companyIcon) {
this.companyIcon = companyIcon;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -