Package javax.swing.table

Examples of javax.swing.table.DefaultTableModel


    cfef.setFieldname("field");
    cfef.setMinimumWidth(new Float(500));
    cfef.setMinimumHeight(new Float(200));
    itemBand.addElement(cfef.createElement());

    final DefaultTableModel tableModel = new DefaultTableModel(new String[]{"field"}, 2000);
    for (int row = 0; row < tableModel.getRowCount(); row++)
    {
      tableModel.setValueAt(new JLabel("Value row = " + row), row, 0);
    }

    report.setDataFactory(new TableDataFactory ("default", tableModel));
   performExportTest(report, "AWT Component processing");
  }
View Full Code Here


    final Properties sysProps = System.getProperties();

    final TreeMap data = new TreeMap(sysProps);
    final Map.Entry[] entries = (Map.Entry[]) data.entrySet().toArray(new Map.Entry[data.size()]);
    final DefaultTableModel properties = new DefaultTableModel(names, entries.length);
    for (int i = 0; i < entries.length; i++)
    {
      final Map.Entry entry = entries[i];
      properties.setValueAt(entry.getKey(), i, 0);
      properties.setValueAt(entry.getValue(), i, 1);
    }

    final JTable table = new JTable(properties);
    final TableColumnModel model = table.getColumnModel();
    TableColumn column = model.getColumn(0);
View Full Code Here

   * Test data generator
   */
  private static TableModel generateReportTable(int tableNum, int rows,
                                            int columns, boolean useLabels)
  {
    DefaultTableModel t = new DefaultTableModel();
    for (int i = 0; i < columns; i++)
    {
      t.addColumn(getReportTableColumnName(i));
    }

    for (int row = 0; row < rows; row++)
    {
      if (useLabels)
      {
        Vector v = new Vector();
        for (int col = 0; col < columns; col++)
        {
          v.add(new JLabel(getReportTableData(tableNum, row, col)));
        }
        t.addRow(v);
      }
      else
      {
        Vector v = new Vector();
        for (int col = 0; col < columns; col++)
        {
          v.add(getReportTableData(tableNum, row, col));
        }
        t.addRow(v);
      }
    }

    return t;
  }
View Full Code Here

        dataFactory.close();
      }
    }
    catch (final ReportDataFactoryException rdfe)
    {
      final TableModel reportData = new DefaultTableModel();
      final DataSchema dataSchema = dataSchemaCompiler.compile
          (reportData, expressions, parameterRow, parameterDefinitions, masterReportElement.getReportEnvironment());
      this.columnNames = collectColumnNames(reportData, parameterRow, expressions);
      this.dataFactoryException = rdfe;
      return dataSchema;
    }
    catch (ReportProcessingException e)
    {
      final TableModel reportData = new DefaultTableModel();
      final DataSchema dataSchema = dataSchemaCompiler.compile
          (reportData, expressions, parameterRow, parameterDefinitions, masterReportElement.getReportEnvironment());
      this.columnNames = collectColumnNames(reportData, parameterRow, expressions);
      this.dataFactoryException = e;
      return dataSchema;
View Full Code Here

        }
      }
    }
    if (offlineTableModel == null)
    {
      return new IndexedTableModel(new DefaultTableModel());
    }
    return offlineTableModel;
  }
View Full Code Here

   */
  private DefaultTableModel createData()
  {
    final String[] columnNames = {"January", "February", "March", "April", "May", "June", "July", "August",
        "September", "October", "November", "December"};
    DefaultTableModel data = new DefaultTableModel(columnNames, 10);

    for (int r = 0; r < 10; r++)
    {
      for (int i = 0; i < 12 && r < 10; i++)
      {
        // we want some negative values
        int neg = -random.nextInt(2);
        if (neg == 0)
        {
          neg = 1;
        }
        final Integer value = new Integer(neg * random.nextInt(30));
        data.setValueAt(value, r, i);
      }
    }
    return data;
  }
View Full Code Here

   */
  private DefaultTableModel createData()
  {
    final String[] columnNames = {"January", "February", "March", "April", "May", "June", "July", "August",
        "September", "October", "November", "December"};
    final DefaultTableModel data = new DefaultTableModel(columnNames, 10);

    for (int r = 0; r < 10; r++)
    {
      for (int i = 0; i < 12 && r < 10; i++)
      {
        final Integer value = new Integer(random.nextInt(30));
        data.setValueAt(value, r, i);
      }
    }

    return data;
  }
View Full Code Here

    final String[] colNames = {
        "year", "language", "votes", "chart"
    };

    return new DefaultTableModel(data, colNames);
  }
View Full Code Here

  public static TableModel createParametrizedTableModel (int i1, String s1)
  {
    assertEquals("Passing primitive parameters failed", 5, i1);
    assertEquals("Passing object parameters failed", "test", s1);
    return new DefaultTableModel();
  }
View Full Code Here

    return new DefaultTableModel();
  }

  public static TableModel createSimpleTableModel ()
  {
    return new DefaultTableModel();
  }
View Full Code Here

TOP

Related Classes of javax.swing.table.DefaultTableModel

Copyright © 2018 www.massapicom. 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.