@Override public Component prepareRenderer(TableCellRenderer renderer, int row, int column) { Component prepareRenderer = super.prepareRenderer(renderer, row, column); if (row % 2 == 1) { Color bkg = prepareRenderer.getBackground(); Color bkgNew = new Color(Math.max(bkg.getRed() - 25, 0), Math.max(bkg.getGreen() - 25, 0), Math.max(bkg.getBlue() - 25, 0)); prepareRenderer.setBackground(bkgNew); } return prepareRenderer; } }
/** * Convenience method to get the rendering component for the given cell. * * @param row the row of the cell to render, where 0 is the first row * @param column the column of the cell to render, where 0 is the first * column * @return the decorated <code>Component</code> used as a stamp to render * the specified cell */ public Component prepareRenderer(int row, int col) { return prepareRenderer(getCellRenderer(row, col), row, col); }
/** * Convenience method to get the rendering component for the given cell. * * @param row the row of the cell to render, where 0 is the first row * @param column the column of the cell to render, where 0 is the first * column * @return the decorated <code>Component</code> used as a stamp to render * the specified cell */ public Component prepareRenderer(int row, int col) { return prepareRenderer(getCellRenderer(row, col), row, col); }
/** * Convenience method to get the rendering component for the given cell. * * @param row the row of the cell to render, where 0 is the first row * @param column the column of the cell to render, where 0 is the first * column * @return the decorated <code>Component</code> used as a stamp to render * the specified cell */ public Component prepareRenderer(int row, int col) { return prepareRenderer(getCellRenderer(row, col), row, col); }
/** * Convenience method to get the rendering component for the given cell. * * @param row the row of the cell to render, where 0 is the first row * @param column the column of the cell to render, where 0 is the first * column * @return the decorated <code>Component</code> used as a stamp to render * the specified cell */ public Component prepareRenderer(int row, int col) { return prepareRenderer(getCellRenderer(row, col), row, col); }
/** * {@inheritDoc} <p> * * Overridden to decorate the tree's renderer after calling super. * At that point, it is only the tree itself that has been decorated. * * @param renderer the <code>TableCellRenderer</code> to prepare * @param row the row of the cell to render, where 0 is the first row * @param column the column of the cell to render, where 0 is the first column * @return the <code>Component</code> used as a stamp to render the specified cell * * @see #applyRenderer(Component, ComponentAdapter) */ @Override public Component prepareRenderer(TableCellRenderer renderer, int row, int column) { Component component = super.prepareRenderer(renderer, row, column); return applyRenderer(component, getComponentAdapter(row, column)); }
public Component prepareRenderer(TableCellRenderer renderer, int rowIndex, int vColIndex) { Component c = super.prepareRenderer(renderer, rowIndex, vColIndex); if (rowIndex % 2 == 0 && !isCellSelected(rowIndex, vColIndex)) { c.setBackground(getBackground()); } else if (isCellSelected(rowIndex, vColIndex)) { c.setBackground(SELECTION_COLOR); } else { // If not shaded, match the table's background c.setBackground(getBackground()); //c.setBackground(new Color(217, 232, 250)); } return c; }
/** * {@inheritDoc} <p> * * Overridden to decorate the tree's renderer after calling super. * At that point, it is only the tree itself that has been decorated. * * @param renderer the <code>TableCellRenderer</code> to prepare * @param row the row of the cell to render, where 0 is the first row * @param column the column of the cell to render, where 0 is the first column * @return the <code>Component</code> used as a stamp to render the specified cell * * @see #applyRenderer(Component, ComponentAdapter) */ @Override public Component prepareRenderer(TableCellRenderer renderer, int row, int column) { Component component = super.prepareRenderer(renderer, row, column); return applyRenderer(component, getComponentAdapter(row, column)); }
/** * {@inheritDoc} <p> * * Overridden to decorate the tree's renderer after calling super. * At that point, it is only the tree itself that has been decorated. * * @param renderer the <code>TableCellRenderer</code> to prepare * @param row the row of the cell to render, where 0 is the first row * @param column the column of the cell to render, where 0 is the first column * @return the <code>Component</code> used as a stamp to render the specified cell * * @see #applyRenderer(Component, ComponentAdapter) */ @Override public Component prepareRenderer(TableCellRenderer renderer, int row, int column) { Component component = super.prepareRenderer(renderer, row, column); return applyRenderer(component, getComponentAdapter(row, column)); }
/** * {@inheritDoc} <p> * * Overridden to decorate the tree's renderer after calling super. * At that point, it is only the tree itself that has been decorated. * * @param renderer the <code>TableCellRenderer</code> to prepare * @param row the row of the cell to render, where 0 is the first row * @param column the column of the cell to render, where 0 is the first column * @return the <code>Component</code> used as a stamp to render the specified cell * * @see #applyRenderer(Component, ComponentAdapter) */ @Override public Component prepareRenderer(TableCellRenderer renderer, int row, int column) { Component component = super.prepareRenderer(renderer, row, column); return applyRenderer(component, getComponentAdapter(row, column)); }
/** * {@inheritDoc} <p> * * Overridden to decorate the tree's renderer after calling super. * At that point, it is only the tree itself that has been decorated. * * @param renderer the <code>TableCellRenderer</code> to prepare * @param row the row of the cell to render, where 0 is the first row * @param column the column of the cell to render, where 0 is the first column * @return the <code>Component</code> used as a stamp to render the specified cell * * @see #applyRenderer(Component, ComponentAdapter) */ @Override public Component prepareRenderer(TableCellRenderer renderer, int row, int column) { Component component = super.prepareRenderer(renderer, row, column); return applyRenderer(component, getComponentAdapter(row, column)); }
for (int r = 0; r < getRowCount(table); r++) { Component comp = table.prepareRenderer(renderer, r, column);
for (int r = 0; r < getRowCount(table); r++) { Component comp = table.prepareRenderer(renderer, r, column);
for (int r = 0; r < getRowCount(table); r++) { Component comp = table.prepareRenderer(renderer, r, column);
for (int r = 0; r < getRowCount(table); r++) { Component comp = table.prepareRenderer(renderer, r, column);