Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class TableCellRender_ControlDocumentos extends DefaultTableCellRenderer{
- private int columna ;
- public TableCellRender_ControlDocumentos(int Colpatron)
- {
- this.columna = Colpatron;
- }
- @Override
- public Component getTableCellRendererComponent (JTable table, Object value, boolean selected, boolean focused, int row, int column)
- {
- super.getTableCellRendererComponent(table, value, selected, focused, row, column);
- JLabel etiqueta = new JLabel();
- if(columna == 4){
- if(selected)
- etiqueta.setBackground (Color.CYAN);
- else
- etiqueta.setBackground (Color.YELLOW);
- }
- if (value instanceof String){
- etiqueta.setOpaque(true);
- etiqueta.setText((String)value);
- }
- return etiqueta;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement