This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am fetching some data from database and showing it in jtable by using AbstractTableModel. Now the columns which I am fetching has some long description like 'Payment Method' is showing 'Payment Met...'. How can I wrap those column name . Please suggest me some solution.
You could try using HTML. I think JTables use JLabels as cell renderers by default, and they'll wrap HTML text, or let you put your own line breaks in. So try setting the column title to "<html>Payment<br>Method</html>"
Failing that, I think you need to supply your own TableCellRenderer, and use a component that will do what you want. You can change the renderer for a single column by using table.getTableColumn(...).setHeaderRenderer(...), or for all the headers at once using table.getTableHeader().setDefaultRenderer(...).