• Post Reply Bookmark Topic Watch Topic
  • New Topic

jfc/swing/JTable  RSS feed

 
Vivekgupta vivek
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to display image on JTable Header
I have tried
TableColumn column=table.getColumnModel().getColumn(1);
JTableHeader hdr=column.getHeader();
DefaultTableCellRenderer ren=new DefaultTableCellRenderer();
ImageIcon icon=new ImageIcon("path");
ren.setIcon(icon);
hdr.setCellRenderer(ren);
But when use this tableHeader gets depressed and become white with text.
What to do???
mail at vivek_kr_g@rediffmail.com
 
Bill Liteplo
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are many simple ways. Here is a utility class that you can use as is or grab ideas from.

Enjoy
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!