Available Methods
- getModel ( )
- setAutoResizeMode ( )
- getColumnCount ( )
- setSelectionMode ( )
- addMouseListener ( )
- getColumnModel ( )
- getTableHeader ( )
- getRowCount ( )
- setRowHeight ( )
- setModel ( )
- getValueAt ( )
- setDefaultRenderer ( )
- getSelectedRow ( )
- DropLocation ( )
- getSelectedRows ( )
- setPreferredScrollableViewportSize ( )
- rowAtPoint ( )
- convertColumnIndexToModel ( )
- setColumnSelectionAllowed ( )
- setRowSorter ( )
- setAutoCreateRowSorter ( )
- setRowSelectionInterval ( )
- setFillsViewportHeight ( )
- setRowSelectionAllowed ( )
- getSelectionBackground ( )
- convertRowIndexToModel ( )
- getRowSorter ( )
- getBackground ( )
- setValueAt ( )
- prepareRenderer ( )
- getDefaultRenderer ( )
- getCellRenderer ( )
- setDefaultEditor ( )
- setTableHeader ( )
- print ( )
- getSelectedColumn ( )
- getRowHeight ( )
- removeEditor ( )
- setAutoCreateColumnsFromModel ( )
- getSelectedRowCount ( )
- scrollRectToVisible ( )
- setFocusable ( )
- setName ( )
- getFont ( )
- getPrintable ( )
- setCellSelectionEnabled ( )
- setColumnSelectionInterval ( )
- getColumnName ( )
- addMouseMotionListener ( )
- getSelectedColumnCount ( )
- getSelectionModel ( )
- editCellAt ( )
- getCellRect ( )
- getCellEditor ( )
- setShowVerticalLines ( )
- setForeground ( )
- setMinimumSize ( )
- getDropLocation ( )
- setBorder ( )
- columnAtPoint ( )
- getSelectionForeground ( )
- setBackground ( )
- repaint ( )
- getSelectedColumns ( )
- getRowSelectionAllowed ( )
- setCursor ( )
- getFontMetrics ( )
- setBounds ( )
- getActionMap ( )
- setShowGrid ( )
- setShowHorizontalLines ( )
- addPropertyChangeListener ( )
- getParent ( )
- addKeyListener ( )
- setComponentPopupMenu ( )
- isEditing ( )
- setGridColor ( )
- isEnabled ( )
- setSize ( )
- setColumnModel ( )
- isRowSelected ( )
- isCellEditable ( )
- getEditorComponent ( )
Related Classes
- java.io.File
- java.awt.Color
- java.awt.event.ActionEvent
- java.awt.event.ActionListener
- javax.swing.JPanel
- java.awt.Dimension
- javax.swing.JFrame
- java.awt.Font
- java.awt.event.MouseEvent
- javax.swing.JLabel
- javax.swing.JButton
- java.awt.event.KeyEvent
- java.awt.BorderLayout
- javax.swing.JOptionPane
- java.awt.Component
- javax.swing.JScrollPane
- javax.swing.JTextField
- javax.swing.SwingUtilities
- java.awt.event.MouseAdapter
- javax.swing.ImageIcon
- java.awt.Point
- javax.swing.JComponent
- javax.swing.JCheckBox
- javax.swing.UIManager
- javax.swing.JComboBox
Java Code Examples for javax.swing.JTable#setColumnSelectionInterval()
The following examples show how to use
javax.swing.JTable#setColumnSelectionInterval() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SwingUtil.java From Repeat with Apache License 2.0 | 4 votes |
public static void highLightCell(JTable table, int row, int column) { table.setRowSelectionInterval(row, row); table.setColumnSelectionInterval(column, column); scrollToSelectedRow(table); }
Example 2
Source File: SwingUtil.java From Repeat with Apache License 2.0 | 4 votes |
public static void focusRowTable(JTable table, int row) { table.setRowSelectionInterval(row, row); table.setColumnSelectionInterval(0, table.getColumnCount() - 1); scrollToSelectedRow(table); }
Example 3
Source File: SwingUtil.java From Repeat with Apache License 2.0 | 4 votes |
public static void focusColumnTable(JTable table, int column) { table.setColumnSelectionInterval(column, column); table.setRowSelectionInterval(0, table.getColumnCount() - 1); }
Example 4
Source File: SwingUtil.java From Repeat with Apache License 2.0 | 4 votes |
public static void focusCellTable(JTable table, int row, int column) { table.setRowSelectionInterval(row, row); table.setColumnSelectionInterval(column, column); }
Example 5
Source File: MenuManager.java From jeveassets with GNU General Public License v2.0 | 4 votes |
private void selectClickedCell(final MouseEvent e) { Object source = e.getSource(); if (source instanceof JTable) { JTable jSelectTable = (JTable) source; Point point = e.getPoint(); if (!jSelectTable.getVisibleRect().contains(point)) { //Ignore clickes outside table return; } int clickedRow = jSelectTable.rowAtPoint(point); int clickedColumn = jSelectTable.columnAtPoint(point); //Rows boolean clickInRowsSelection; if (jSelectTable.getRowSelectionAllowed()) { //clicked in selected rows? clickInRowsSelection = false; int[] selectedRows = jSelectTable.getSelectedRows(); for (int i = 0; i < selectedRows.length; i++) { if (selectedRows[i] == clickedRow) { clickInRowsSelection = true; break; } } } else { //Row selection not allowed - all rows selected clickInRowsSelection = true; } //Column boolean clickInColumnsSelection; if (jSelectTable.getColumnSelectionAllowed()) { //clicked in selected columns? clickInColumnsSelection = false; int[] selectedColumns = jSelectTable.getSelectedColumns(); for (int i = 0; i < selectedColumns.length; i++) { if (selectedColumns[i] == clickedColumn) { clickInColumnsSelection = true; break; } } } else { //Column selection not allowed - all columns selected clickInColumnsSelection = true; } //Clicked outside selection, select clicked cell if ( (!clickInRowsSelection || !clickInColumnsSelection) && clickedRow >= 0 && clickedColumn >= 0) { jSelectTable.setRowSelectionInterval(clickedRow, clickedRow); jSelectTable.setColumnSelectionInterval(clickedColumn, clickedColumn); } } }