Example usage for javax.swing.table DefaultTableCellRenderer setBorder

List of usage examples for javax.swing.table DefaultTableCellRenderer setBorder

Introduction

In this page you can find the example usage for javax.swing.table DefaultTableCellRenderer setBorder.

Prototype

@BeanProperty(preferred = true, visualUpdate = true, description = "The component's border.")
public void setBorder(Border border) 

Source Link

Document

Sets the border of this component.

Usage

From source file:org.pgptool.gui.ui.keyslist.KeysTableView.java

private void adjustColumnsWidths() {
    DefaultTableCellRenderer leftRenderer = new DefaultTableCellRenderer();
    leftRenderer.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
    leftRenderer.setHorizontalAlignment(JLabel.LEFT);

    DefaultTableCellRenderer rightRenderer = new DefaultTableCellRenderer();
    rightRenderer.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
    rightRenderer.setHorizontalAlignment(JLabel.RIGHT);

    DefaultTableCellRenderer centerRenderer = new DefaultTableCellRenderer();
    centerRenderer.setHorizontalAlignment(JLabel.CENTER);

    adjustColumn(leftRenderer, KeysTableModel.COLUMN_USER, spacing(30), leftRenderer);
    adjustColumn(leftRenderer, KeysTableModel.COLUMN_KEY_ID, spacing(16), centerRenderer);
    adjustColumn(leftRenderer, KeysTableModel.COLUMN_KEY_TYPE, spacing(8), centerRenderer);
    adjustColumn(leftRenderer, KeysTableModel.COLUMN_ALGORITHM, spacing(13), centerRenderer);
    adjustColumn(leftRenderer, KeysTableModel.COLUMN_CREATED_ON, spacing(10), centerRenderer);
    adjustColumn(leftRenderer, KeysTableModel.COLUMN_EXPIRES_AT, spacing(10), centerRenderer);
}

From source file:org.pgptool.gui.ui.mainframe.MainFrameView.java

private void adjustColumnsWidths() {
    DefaultTableCellRenderer leftRenderer = new DefaultTableCellRenderer();
    leftRenderer.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
    leftRenderer.setHorizontalAlignment(JLabel.LEFT);
    adjustColumn(leftRenderer, DecryptedFilesModel.COLUMN_ENCRYPTED_FILE, 50, leftRenderer);
    adjustColumn(leftRenderer, DecryptedFilesModel.COLUMN_DECRYPTED_FILE, 50, leftRenderer);
}