public static Image createImage(final JTable table, int column) { final int height = Math.max(20, Math.min(100, table.getSelectedRowCount() * table.getRowHeight())); final int width = table.getColumnModel().getColumn(column).getWidth(); final BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); Graphics2D g2 = (Graphics2D) image.getGraphics(); g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.7f)); drawSelection(table, column, g2, width); return image; }