/*
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * published by the Free Software Foundation; either version 2.1 of
 * the license, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *  
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite
 * 330, Boston, MA  02111-1307, USA.
 * 
 */
package com.k_int.AdminApp.widgets;

import java.util.Date;

import java.text.SimpleDateFormat;

import javax.swing.table.DefaultTableCellRenderer;

import java.awt.Dimension;

/**
 * Title:		DateCellRenderer
 * @author:		rob
 * @version:	$Id: DateCellRenderer.java,v 1.1 2004/11/15 13:47:50 rob Exp $
 * Copyright:	Copyright 1999-2004 Knowledge Integration Ltd
 * Company: 	Knowledge Integration Ltd
 * Description:
 * 
 * 
 * Created:		23-Aug-2004  12:45:06
 * 
 * 
 * History:		$Log: DateCellRenderer.java,v $
 * History:		Revision 1.1  2004/11/15 13:47:50  rob
 * History:		*** empty log message ***
 * History:		
 *
 */
public class DateCellRenderer extends DefaultTableCellRenderer 
{
    
    private SimpleDateFormat format;// = new SimpleDateFormat();
    
    public DateCellRenderer()
    {
        super();
        format=new SimpleDateFormat();
    }
       
    public DateCellRenderer(String date_string)
    {
        super(); 
        format = new SimpleDateFormat(date_string);  
    }
   
 
    protected void setValue(Object value)
    {
        if(value instanceof Date)
        {
            super.setValue(format.format((Date) value));
        }
        else
            super.setValue(value);    
    }
    
    
}
