Example usage for javax.swing JTable setSurrendersFocusOnKeystroke

List of usage examples for javax.swing JTable setSurrendersFocusOnKeystroke

Introduction

In this page you can find the example usage for javax.swing JTable setSurrendersFocusOnKeystroke.

Prototype

public void setSurrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke) 

Source Link

Document

Sets whether editors in this JTable get the keyboard focus when an editor is activated as a result of the JTable forwarding keyboard events for a cell.

Usage

From source file:nz.govt.natlib.ndha.manualdeposit.ManualDepositPresenter.java

private void setJobQueueTableDefaults(JTable jobQueueTable, JobQueueTableModel jobQueueTableModel) {
    jobQueueTableModel.addTableModelListener(new JobQueueTableModelListener());
    jobQueueTable.setModel(jobQueueTableModel);
    jobQueueTable.setSurrendersFocusOnKeystroke(true);
    jobQueueTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
    jobQueueTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    jobQueueTable.setColumnSelectionAllowed(true);
    jobQueueTable.setRowSelectionAllowed(true);
    TableRenderer renderer = new TableRenderer();
    TableColumn col = jobQueueTable.getColumnModel().getColumn(0);
    int width = 200;
    col.setPreferredWidth(width);//from w  w w  .  ja v a  2  s.  co m
    col.setWidth(width);
    col.setCellRenderer(renderer);

    col = jobQueueTable.getColumnModel().getColumn(1);
    width = 1400;
    col.setPreferredWidth(width);
    col.setWidth(width);
    col.setCellRenderer(renderer);
}