Example usage for javax.swing.table TableColumn setHeaderValue

List of usage examples for javax.swing.table TableColumn setHeaderValue

Introduction

In this page you can find the example usage for javax.swing.table TableColumn setHeaderValue.

Prototype

@BeanProperty(description = "The text to be used by the header renderer.")
public void setHeaderValue(Object headerValue) 

Source Link

Document

Sets the Object whose string representation will be used as the value for the headerRenderer.

Usage

From source file:org.piraso.ui.base.ContextMonitorTopComponent.java

private void initColumns() {
    TableColumn numColumn = table.getColumnModel().getColumn(0);
    TableColumn messageColumn;/*from   w w  w .  j ava  2s .co  m*/
    TableColumn elapseColumn;

    numColumn.setHeaderValue("");
    numColumn.setMaxWidth(43);
    numColumn.setCellRenderer(CELL_RENDERER);

    showType = SingleModelManagers.GENERAL_SETTINGS.get().isShowType();
    if (showType) {
        TableColumn typeColumn = table.getColumnModel().getColumn(1);
        messageColumn = table.getColumnModel().getColumn(2);

        typeColumn.setHeaderValue("Type");
        typeColumn.setMaxWidth(125);
        typeColumn.setCellRenderer(CELL_RENDERER);
    } else {
        messageColumn = table.getColumnModel().getColumn(1);
    }

    showElapseTime = SingleModelManagers.GENERAL_SETTINGS.get().isShowElapseTime();
    if (showElapseTime) {
        if (showType) {
            elapseColumn = table.getColumnModel().getColumn(3);
        } else {
            elapseColumn = table.getColumnModel().getColumn(2);
        }

        elapseColumn.setHeaderValue("Elapse");
        elapseColumn.setMaxWidth(100);
        elapseColumn.setCellRenderer(CELL_RENDERER);
    }

    messageColumn.setHeaderValue("Message");
    messageColumn.setPreferredWidth(700);
    messageColumn.setCellRenderer(CELL_RENDERER);
}

From source file:org.piraso.ui.base.ExportDialog.java

private void initTable() {
    TableColumn selectionColumn = jtable.getColumnModel().getColumn(0);
    TableColumn boldOption = jtable.getColumnModel().getColumn(1);

    selectionColumn.setHeaderValue("");
    selectionColumn.setPreferredWidth(30);
    selectionColumn.setMaxWidth(30);/* ww  w  .j a  va2s  .com*/
    selectionColumn.setCellEditor(jtable.getDefaultEditor(Boolean.class));
    selectionColumn.setCellRenderer(jtable.getDefaultRenderer(Boolean.class));

    boldOption.setHeaderValue("Option");
    boldOption.setPreferredWidth(200);

    jtable.setShowHorizontalLines(false);
    jtable.setAutoscrolls(true);
    jtable.setColumnSelectionAllowed(false);
    jtable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    jtable.getTableHeader().setReorderingAllowed(false);
}

From source file:org.piraso.ui.base.ProfilesDialog.java

private void initTable() {
    TableColumn nameColumn = jtable.getColumnModel().getColumn(0);
    TableColumn urlColumn = jtable.getColumnModel().getColumn(1);
    TableColumn watchColumn = jtable.getColumnModel().getColumn(2);

    nameColumn.setHeaderValue("Name");
    urlColumn.setPreferredWidth(210);/* w ww. j av  a  2 s. c o  m*/
    nameColumn.setMaxWidth(235);

    urlColumn.setHeaderValue("Logging URL");
    urlColumn.setPreferredWidth(220);
    urlColumn.setMaxWidth(700);

    watchColumn.setHeaderValue("Watch Address");
    watchColumn.setMaxWidth(200);

    jtable.setShowHorizontalLines(false);
    jtable.setAutoscrolls(true);
    jtable.setColumnSelectionAllowed(false);
    jtable.getTableHeader().setReorderingAllowed(false);
}

From source file:org.piraso.ui.base.SaveMonitorInstanceDialog.java

private void initTable() {
    TableColumn selectionColumn = jtable.getColumnModel().getColumn(0);
    TableColumn boldOption = jtable.getColumnModel().getColumn(1);

    selectionColumn.setHeaderValue("");
    selectionColumn.setPreferredWidth(30);
    selectionColumn.setMaxWidth(30);/*from w  w w  .  j  av  a  2  s  .  c o  m*/
    selectionColumn.setCellEditor(jtable.getDefaultEditor(Boolean.class));
    selectionColumn.setCellRenderer(jtable.getDefaultRenderer(Boolean.class));

    boldOption.setHeaderValue("Request URL");
    boldOption.setPreferredWidth(200);

    jtable.setShowHorizontalLines(false);
    jtable.setAutoscrolls(true);
    jtable.setColumnSelectionAllowed(false);
    jtable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    jtable.getTableHeader().setReorderingAllowed(false);
}

From source file:org.piraso.ui.log4j.Log4jPreferenceDialog.java

private void initTable() {
    TableColumn loggerColumn = jtable.getColumnModel().getColumn(0);
    TableColumn descriptionColumn = jtable.getColumnModel().getColumn(1);

    loggerColumn.setHeaderValue("Logger");
    loggerColumn.setPreferredWidth(120);

    descriptionColumn.setHeaderValue("Description");
    descriptionColumn.setPreferredWidth(300);

    jtable.setShowHorizontalLines(false);
    jtable.setAutoscrolls(true);/*from  w  w w . j a  v  a 2  s .c o m*/
    jtable.setColumnSelectionAllowed(false);
    jtable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    jtable.getTableHeader().setReorderingAllowed(false);
}

From source file:org.piraso.ui.sql.SQLViewTopComponent.java

private void initTable() {
    TableColumn numColumn = table.getColumnModel().getColumn(0);
    TableColumn methodColumn = table.getColumnModel().getColumn(1);
    TableColumn typeColumn = table.getColumnModel().getColumn(2);
    TableColumn valueColumn = table.getColumnModel().getColumn(3);

    numColumn.setHeaderValue("");
    numColumn.setMaxWidth(30);/*from w  w  w  .  j  a  v  a2 s . c o  m*/
    numColumn.setCellRenderer(new AlignableTableCellRendererImpl(SwingConstants.RIGHT, false, true));

    methodColumn.setHeaderValue("Method");
    methodColumn.setPreferredWidth(300);

    typeColumn.setHeaderValue("Type");
    typeColumn.setPreferredWidth(200);

    valueColumn.setHeaderValue("Value");
    valueColumn.setPreferredWidth(200);
}

From source file:pcgen.gui2.tabs.EquipInfoTab.java

private DynamicTableColumnModel createEquipmentColumnModel() {
    PrefTableColumnModel model = new PrefTableColumnModel("EquipList", 1);

    TableColumn column = new TableColumn(0);
    column.setHeaderValue(LanguageBundle.getString("in_nameLabel")); //$NON-NLS-1$
    model.addColumn(column, true, 150);//from   www  .java2  s  .c o m
    column = new TableColumn(1);
    column.setHeaderValue(LanguageBundle.getString("in_type")); //$NON-NLS-1$
    model.addColumn(column, true, 75);
    column = new TableColumn(2);
    column.setHeaderValue(LanguageBundle.getString("in_equipLocationAbbrev")); //$NON-NLS-1$
    model.addColumn(column, true, 75);
    column = new TableColumn(3);
    column.setHeaderValue(LanguageBundle.getString("in_equipQuantityAbbrev")); //$NON-NLS-1$
    model.addColumn(column, true, 75);
    column = new TableColumn(4);
    column.setHeaderValue(LanguageBundle.getString("in_equipWeightAbbrev")); //$NON-NLS-1$
    model.addColumn(column, true, 75);
    column = new TableColumn(5);
    column.setHeaderValue(LanguageBundle.getString("in_descrip")); //$NON-NLS-1$
    model.addColumn(column, false, 75);
    return model;
}