Package javax.swing.table

Examples of javax.swing.table.DefaultTableColumnModel


        super();
        tmSpent=new NonEditableDefaultTableModel();
        super.setModel(tmSpent);
        super.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        //this.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
        dtcColumns=new DefaultTableColumnModel();
        super.setColumnModel(dtcColumns);
        nfDecimal=new DecimalFormat("##0.00");
    }
View Full Code Here


  // Sets the preferred width of the visible column specified by vColIndex.
  // The column will be just wide enough to show the column head and the
  // widest cell in the column. margin pixels are added to the left and right
  // (resulting in an additional width of 2*margin pixels).
  private static void packColumn(JTable table, int vColIndex, int margin) {
    DefaultTableColumnModel colModel = (DefaultTableColumnModel) table.getColumnModel();
    TableColumn col = colModel.getColumn(vColIndex);
    int width = 0;

    // Get width of column header
    TableCellRenderer renderer = col.getHeaderRenderer();
    if (renderer == null) {
View Full Code Here

  // Sets the preferred width of the visible column specified by vColIndex.
  // The column will be just wide enough to show the column head and the
  // widest cell in the column. margin pixels are added to the left and right
  // (resulting in an additional width of 2*margin pixels).
  private static void packColumn(JTable table, int vColIndex, int margin) {
    DefaultTableColumnModel colModel = (DefaultTableColumnModel) table.getColumnModel();
    TableColumn col = colModel.getColumn(vColIndex);
    int width = 0;

    // Get width of column header
    TableCellRenderer renderer = col.getHeaderRenderer();
    if (renderer == null) {
View Full Code Here

        String[] resultVectorTableColumnNames = {"Key",
                                                 "DataObject",
                                                 "Core-Distance",
                                                 "Reachability-Distance"};

        DefaultTableColumnModel resultVectorTableColumnModel = new DefaultTableColumnModel();
        for (int i = 0; i < resultVectorTableColumnNames.length; i++) {
            TableColumn tc = new TableColumn(i);
            tc.setHeaderValue(resultVectorTableColumnNames[i]);
            resultVectorTableColumnModel.addColumn(tc);
        }

        ResultVectorTableModel resultVectorTableModel = new ResultVectorTableModel(serObject.getResultVector());
        resultVectorTable = new JTable(resultVectorTableModel, resultVectorTableColumnModel);
        resultVectorTable.getColumnModel().getColumn(0).setPreferredWidth(70);
View Full Code Here

    Point point = serverMonitor.getMainMonitorGUI().getLocation();
    setLocation(point.x + 20, point.y + 20);
    setSize(500, 300);

    DefaultTableColumnModel defaultColumn = (DefaultTableColumnModel) activityTable.getColumnModel();

    defaultColumn.getColumn(0).setResizable(false);
    defaultColumn.getColumn(0).setPreferredWidth(120);
    defaultColumn.getColumn(0).setMaxWidth(120);

    defaultColumn = (DefaultTableColumnModel) detailsTable.getColumnModel();
    defaultColumn.getColumn(0).setPreferredWidth(120);
    defaultColumn.getColumn(0).setMaxWidth(250);

    setVisible(true);

    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
View Full Code Here

        Point point = serverMonitor.getMainMonitorGUI().getLocation();
        setLocation(point.x + 20, point.y + 20);
        setSize(500, 300);

        DefaultTableColumnModel defaultColumn = (DefaultTableColumnModel) activityTable.getColumnModel();

        defaultColumn.getColumn(0).setResizable(false);
        defaultColumn.getColumn(0).setPreferredWidth(120);
        defaultColumn.getColumn(0).setMaxWidth(120);

        defaultColumn = (DefaultTableColumnModel) detailsTable.getColumnModel();
        defaultColumn.getColumn(0).setPreferredWidth(120);
        defaultColumn.getColumn(0).setMaxWidth(250);

        setVisible(true);

        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
View Full Code Here

        packColumn(1, 2);
    }
   
   
    private void packColumn(int vColIndex, int margin) {
        DefaultTableColumnModel colModel = (DefaultTableColumnModel)getColumnModel();
        TableColumn col = colModel.getColumn(vColIndex);
        int width = 0;
   
        // Get width of column header
        TableCellRenderer renderer = col.getHeaderRenderer();
        if (renderer == null) {
View Full Code Here

        dialog.dispose();
    }

    @Test
    public void testTableHeaderExists() throws Exception {
        TableColumnModel model = new DefaultTableColumnModel();
        TableColumn column = new TableColumn(0);
        column.setIdentifier("header_name");
        model.addColumn(column);
        JTableHeader tableHeader = new JTableHeader(model);
        MTableHeaderItem header = new MTableHeaderItem(tableHeader, "table_name", "header_name", null, WindowMonitor.getInstance());
        assertEquals("header_name", header.getText());
    }
View Full Code Here

    protected TableModel createDefaultDataModel() {
        return new DefaultTableModel();
    }

    protected TableColumnModel createDefaultColumnModel() {
        return new DefaultTableColumnModel();
    }
View Full Code Here

    protected TableModel createDefaultDataModel() {
        return new DefaultTableModel();
    }

    protected TableColumnModel createDefaultColumnModel() {
        return new DefaultTableColumnModel();
    }
View Full Code Here

TOP

Related Classes of javax.swing.table.DefaultTableColumnModel

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.