Hello...
I'm doing a swing app. The functions included are to print the Jtable...
in Colum 3 i've applied wrapping word in a cell.. the problem is when i print the table, the border in column 3 which wrap the word will not be visible...y?how can i solve this problem...can see my code like below
Code:MyCellRenderer cellRenderer = new MyCellRenderer(); TableColumn column = null; column = tblProgram.getColumn(ResourceBundle.getBundle("Program").getString("TBL_DESC")); //get data in column 3 column.setCellRenderer(cellRenderer);ty in advanceCode:public class MyCellRenderer extends JTextArea implements TableCellRenderer { public MyCellRenderer() { setLineWrap(true); setWrapStyleWord(true); setMargin(new Insets(0, 5, 0, 5)); } public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { setText((String)value); setSize(table.getColumnModel().getColumn(column).getWidth(), getPreferredSize().height); if (table.getRowHeight(row) != getPreferredSize().height) { table.setRowHeight(row, getPreferredSize().height); } return this; } }![]()


Reply With Quote


Bookmarks