Package javax.swing

Examples of javax.swing.JTable.addColumn()


   */
  public void test(TestHarness harness)     
  {
    JTable table = new JTable();
    TableColumn c = new TableColumn();
    table.addColumn(c);
    TableColumnModel tcm = table.getColumnModel();
    harness.check(tcm.getColumnCount(), 1);
   
    boolean pass = false;
    try
View Full Code Here


    harness.check(tcm.getColumnCount(), 1);
   
    boolean pass = false;
    try
    {
      table.addColumn(null);
    }
    catch (NullPointerException e)
    {
      pass = true;
    }
View Full Code Here

        assertEquals("any value", renderer.getText());
        assertSame(UIManager.getBorder("Table.focusCellHighlightBorder"), renderer.getBorder());
        assertEquals(table.getSelectionBackground(), renderer.getBackground());
        assertEquals(table.getSelectionForeground(), renderer.getForeground());
        assertEquals(table.getFont(), renderer.getFont());
        table.addColumn(new TableColumn());
        assertSame(renderer, renderer.getTableCellRendererComponent(table, "any value", true,
                true, 0, 0));
        assertEquals("any value", renderer.getText());
        assertSame(UIManager.getBorder("Table.focusCellHighlightBorder"), renderer.getBorder());
        assertEquals(table.getSelectionBackground(), renderer.getBackground());
View Full Code Here

            @Override
            public boolean isCellEditable(final int row, final int column) {
                return false;
            }
        });
        table.addColumn(new TableColumn());
        assertSame(renderer, renderer.getTableCellRendererComponent(table, "any value", true,
                true, 0, 0));
        assertEquals("any value", renderer.getText());
        assertSame(UIManager.getBorder("Table.focusCellHighlightBorder"), renderer.getBorder());
        assertEquals(table.getSelectionBackground(), renderer.getBackground());
View Full Code Here

        assertEquals(new Dimension(), ui.getMinimumSize(null));
        TableColumn column1 = new TableColumn();
        column1.setMinWidth(20);
        column1.setPreferredWidth(50);
        column1.setMaxWidth(100);
        table.addColumn(column1);
        assertEquals(new Dimension(20, 0), ui.getMinimumSize(null));
        assertEquals(new Dimension(100, 0), ui.getMaximumSize(null));
        assertEquals(new Dimension(50, 0), ui.getPreferredSize(null));
        TableColumn column2 = new TableColumn();
        column2.setMinWidth(10);
View Full Code Here

        assertEquals(new Dimension(50, 0), ui.getPreferredSize(null));
        TableColumn column2 = new TableColumn();
        column2.setMinWidth(10);
        column2.setPreferredWidth(20);
        column2.setMaxWidth(40);
        table.addColumn(column2);
        assertEquals(new Dimension(30, 0), ui.getMinimumSize(null));
        assertEquals(new Dimension(140, 0), ui.getMaximumSize(null));
        assertEquals(new Dimension(70, 0), ui.getPreferredSize(null));
        table.setRowHeight(30);
        ((DefaultTableModel) table.getModel()).addRow(new Object[] { "1" });
View Full Code Here

            @Override
            public boolean isCellEditable(final int row, final int column) {
                return false;
            }
        });
        table.addColumn(new TableColumn());
        assertSame(renderer, renderer.getTableCellRendererComponent(table, "any value", true,
                true, 0, 0));
        assertEquals("any value", renderer.getText());
        assertSame(UIManager.getBorder("Table.focusCellHighlightBorder"), renderer.getBorder());
        assertEquals(table.getSelectionBackground(), renderer.getBackground());
View Full Code Here

        assertEquals("any value", renderer.getText());
        assertSame(UIManager.getBorder("Table.focusCellHighlightBorder"), renderer.getBorder());
        assertEquals(table.getSelectionBackground(), renderer.getBackground());
        assertEquals(table.getSelectionForeground(), renderer.getForeground());
        assertEquals(table.getFont(), renderer.getFont());
        table.addColumn(new TableColumn());
        assertSame(renderer, renderer.getTableCellRendererComponent(table, "any value", true,
                true, 0, 0));
        assertEquals("any value", renderer.getText());
        assertSame(UIManager.getBorder("Table.focusCellHighlightBorder"), renderer.getBorder());
        assertEquals(table.getSelectionBackground(), renderer.getBackground());
View Full Code Here

   @Test
   public void testMouseClicked_work()
   {
      System.out.println("mouseClicked");
      JTable table=new JTable();
      table.addColumn(new TableColumn());
      MouseEvent evt = new MouseEvent(table.getTableHeader(), 1, 1, 1, 10, 10, 1, true);
      HeaderClickCheckAllListener instance = new HeaderClickCheckAllListener();
      instance.mouseClicked(evt);
   }
}
View Full Code Here

        assertEquals(new Dimension(), ui.getMinimumSize(null));
        TableColumn column1 = new TableColumn();
        column1.setMinWidth(20);
        column1.setPreferredWidth(50);
        column1.setMaxWidth(100);
        table.addColumn(column1);
        assertEquals(new Dimension(20, 0), ui.getMinimumSize(null));
        assertEquals(new Dimension(100, 0), ui.getMaximumSize(null));
        assertEquals(new Dimension(50, 0), ui.getPreferredSize(null));
        TableColumn column2 = new TableColumn();
        column2.setMinWidth(10);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.