/** Overridden to hide the selection when not focused, and paint across the * selected row if focused. */ public Component prepareRenderer(TableCellRenderer renderer, int row, int col) { Object value = getValueAt(row, col); Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner(); boolean isSelected = isSelected(row, focusOwner); Component result = renderer.getTableCellRendererComponent(this, value, isSelected, false, row, col); return result; }
/** Overridden to hide the selection when not focused, and paint across the * selected row if focused. */ public Component prepareRenderer(TableCellRenderer renderer, int row, int col) { Object value = getValueAt(row, col); Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner(); boolean isSelected = isSelected(row, focusOwner); Component result = renderer.getTableCellRendererComponent(this, value, isSelected, false, row, col); return result; }
/** Overridden to hide the selection when not focused, and paint across the * selected row if focused. */ public Component prepareRenderer(TableCellRenderer renderer, int row, int col) { Object value = getValueAt(row, col); Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner(); boolean isSelected = isSelected(row, focusOwner); Component result = renderer.getTableCellRendererComponent(this, value, isSelected, false, row, col); return result; }
/** Overridden to set the colors apropriately - we always want the editor * to appear selected */ public Component prepareEditor(TableCellEditor editor, int row, int col) { Component result = editor.getTableCellEditorComponent(this, getValueAt(row, col), false, row, col); if (result != null) { result.setBackground(getSelectionBackground()); result.setForeground(getSelectionForeground()); result.setFont(getFont()); } return result; }
/** Overridden to set the colors apropriately - we always want the editor * to appear selected */ public Component prepareEditor(TableCellEditor editor, int row, int col) { Component result = editor.getTableCellEditorComponent( this, getValueAt(row, col), false, row, col); if (result != null) { result.setBackground(getSelectionBackground()); result.setForeground(getSelectionForeground()); result.setFont(getFont()); } return result; }
private void forwardSearch(String txt) { if (txt == null || txt.length() == 0) { return; } int max = getRowCount(); int pos = getSelectedRow()+1; if (pos == max - 1 || pos < 0) { pos = 0; } for (int i=pos; i < max; i++) { boolean match = matchText(BaseTable.this.getValueAt(i, 0), txt); if (match) { changeSelection(i, 0, false, false); //Set renderers can overpaint it, so repaint repaint(); break; } } }
private void reverseSearch(String txt) { if (txt == null || txt.length() == 0) { return; } int max = getRowCount(); int pos = getSelectedRow(); if (pos < 1) { pos = max-1; } for (int i=pos-1; i >=0; i--) { boolean match = matchText(BaseTable.this.getValueAt(i, 0), txt); if (match) { changeSelection(i, 0, false, false); //Set renderers can overpaint it, so repaint repaint(); break; } } }
private void reverseSearch(String txt) { if (txt == null || txt.length() == 0) { return; } int max = getRowCount(); int pos = getSelectedRow(); if (pos < 1) { pos = max-1; } for (int i=pos-1; i >=0; i--) { boolean match = matchText(BaseTable.this.getValueAt(i, 0), txt); if (match) { changeSelection(i, 0, false, false); //Set renderers can overpaint it, so repaint repaint(); break; } } }
/** Overridden to set the colors apropriately - we always want the editor * to appear selected */ public Component prepareEditor(TableCellEditor editor, int row, int col) { Component result = editor.getTableCellEditorComponent( this, getValueAt(row, col), false, row, col); if (result != null) { result.setBackground(getSelectionBackground()); result.setForeground(getSelectionForeground()); result.setFont(getFont()); } return result; }
private void reverseSearch(String txt) { if ((txt == null) || (txt.length() == 0)) { return; } int max = getRowCount(); int pos = getSelectedRow(); if (pos < 1) { pos = max - 1; } for (int i = pos - 1; i >= 0; i--) { boolean match = matchText(BaseTable.this.getValueAt(i, 0), txt); if (match) { changeSelection(i, 0, false, false); //Set renderers can overpaint it, so repaint repaint(); break; } } }
private void forwardSearch(String txt) { if (txt == null || txt.length() == 0) { return; } int max = getRowCount(); int pos = getSelectedRow()+1; if (pos == max - 1 || pos < 0) { pos = 0; } for (int i=pos; i < max; i++) { boolean match = matchText(BaseTable.this.getValueAt(i, 0), txt); if (match) { changeSelection(i, 0, false, false); //Set renderers can overpaint it, so repaint repaint(); break; } } }
private void processSearchText(String txt) { if (txt == null || txt.length() == 0) { return; } int max = getRowCount(); int pos = getSelectedRow(); if (pos == max - 1 || pos < 0) { pos = 0; } for (int i=0; i < max; i++) { boolean match = matchText(BaseTable.this.getValueAt(i, 0), txt); if (match) { changeSelection(i, 0, false, false); //Set renderers can overpaint it, so repaint repaint(); break; } if (pos++ == max -1) { pos = 0; } } }
private void forwardSearch(String txt) { if ((txt == null) || (txt.length() == 0)) { return; } int max = getRowCount(); int pos = getSelectedRow() + 1; if ((pos == (max - 1)) || (pos < 0)) { pos = 0; } for (int i = pos; i < max; i++) { boolean match = matchText(BaseTable.this.getValueAt(i, 0), txt); if (match) { changeSelection(i, 0, false, false); //Set renderers can overpaint it, so repaint repaint(); break; } } }
private void processSearchText(String txt) { if (txt == null || txt.length() == 0) { return; } int max = getRowCount(); int pos = getSelectedRow(); if (pos == max - 1 || pos < 0) { pos = 0; } for (int i=0; i < max; i++) { boolean match = matchText(BaseTable.this.getValueAt(i, 0), txt); if (match) { changeSelection(i, 0, false, false); //Set renderers can overpaint it, so repaint repaint(); break; } if (pos++ == max -1) { pos = 0; } } }
private void processSearchText(String txt) { if ((txt == null) || (txt.length() == 0)) { return; } int max = getRowCount(); int pos = getSelectedRow(); if ((pos == (max - 1)) || (pos < 0)) { pos = 0; } for (int i = 0; i < max; i++) { boolean match = matchText(BaseTable.this.getValueAt(i, 0), txt); if (match) { changeSelection(i, 0, false, false); //Set renderers can overpaint whole field's panel, so repaint getRootPane().getLayeredPane().repaint(); break; } if (pos++ == (max - 1)) { pos = 0; } } }