Back to project page SmartTools.
The source code is released under:
GNU General Public License
If you think the Android project SmartTools listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.nj.simba.page.appmgr; /*from w w w . j a v a2 s . c o m*/ import java.awt.Color; import java.awt.Component; import javax.swing.ImageIcon; import javax.swing.JTable; import javax.swing.table.DefaultTableCellRenderer; @SuppressWarnings("serial") public class AppTableRender extends DefaultTableCellRenderer { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); setOpaque(isSelected); if(isSelected) { setBackground(Color.WHITE); setForeground(Color.BLACK); } else { setForeground(Color.WHITE); } /** cts is fail! **/ // if ( column == 3 && !(Boolean) value) { // setBackground(Color.RED); // setForeground(Color.BLACK); // setOpaque(true); // } if (column == 0) { setText(null); setIcon(new ImageIcon((byte[])value)); } else { setText(value.toString()); setIcon(null); } return this; } }