/* CVS: $Id: IconTable.java,v 1.2 2001/03/11 21:39:01 gvijf Exp $ */ package gui; import javax.swing.*; import javax.swing.table.*; import java.awt.*; public class IconTable extends AbstractTableModel { public IconTable(int width, int height) { this.width = width; this.height = height; data = new ImageIcon[width][height]; for(int i = 0; i < width; i++) for(int j = 0; j < height; j++) data[i][j] = new ImageIcon(); } public int getRowCount() { return height; } public int getColumnCount() { return width; } public Object getValueAt(int row, int column) { return data[row][column]; } public void setValueAt(Object value, int row, int column) { data[row][column] = (ImageIcon) value; } public Class getColumnClass(int c) { return ImageIcon.class; } public String getColumnName(int c) { return c + ""; } private int width; private int height; private ImageIcon data[][]; }