1 7 package org.jdesktop.swing; 8 9 import javax.swing.JFrame ; 10 import javax.swing.table.DefaultTableModel ; 11 import javax.swing.table.TableCellRenderer ; 12 13 import org.jdesktop.swing.decorator.ComponentAdapter; 14 import org.jdesktop.swing.decorator.Filter; 15 import org.jdesktop.swing.decorator.FilterPipeline; 16 import org.jdesktop.swing.decorator.PatternFilter; 17 import org.jdesktop.swing.decorator.PipelineListener; 18 19 import junit.framework.TestCase; 20 21 24 public class JXTableIssues extends TestCase { 25 26 private DefaultTableModel createModel(int startRow, int count) { 27 DefaultTableModel model = new DefaultTableModel (count, 5); 28 for (int i = 0; i < model.getRowCount(); i++) { 29 model.setValueAt(new Integer (startRow++), i, 0); 30 } 31 return model; 32 } 33 34 38 public void testNewRendererInstance() { 39 JXTable table = new JXTable(); 40 TableCellRenderer newRenderer = table.getNewDefaultRenderer(Boolean .class); 41 TableCellRenderer sharedRenderer = table.getDefaultRenderer(Boolean .class); 42 assertNotNull(newRenderer); 43 assertNotSame("new renderer must be different from shared", sharedRenderer, newRenderer); 44 assertNotSame("new renderer must be different from object renderer", 45 table.getDefaultRenderer(Object .class), newRenderer); 46 } 47 48 49 } 54 | Popular Tags |