I have a Jtable in which I have to show some big data. I can not increase the size of the cells. Therefore, I need to add a scroll bar to each cell of the table through which I can scroll through the text of the cells.
I tried to add Custom Cell Renderer
private class ExtendedTableCellEditor extends AbstractCellEditor implements TableCellEditor { JLabel area = new JLabel(); String text; public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int rowIndex, int vColIndex) { area.setText(text); return new JScrollPane(area); } public Object getCellEditorValue() { return text; } }
Now I can see the scroll bar on the cells, but I can not click and scroll them.
Any suggestions on this would be great. Thanks at Advance.
source share