GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes JTable column headers in 1.3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable column headers in 1.3" Watch "JTable column headers in 1.3" New topic
Author

JTable column headers in 1.3

glen kaatz
Greenhorn

Joined: Apr 29, 2001
Posts: 6
I'm sooo close. Please help. I want to make column headings for my table. The headings aren't showing up. If I say tc.setCellRenderer( new myRend() ); it uses my "header renderer" for each cell so I know that part works. When I say tc.setHeaderRendere( new myRend() ) it doesn't break but it doesn't do anything. I can see the constructor being called via a sysout but it is never getting to the getTableCellRendererComponent method - leads me to believe it doesn't think it has any cells to render...but - if I print to sysout the header value tc.getHeaderValue() it shows the string I want to display.
I have to be close. Any guesses?
Muchas gracias.
glen kaatz
Greenhorn

Joined: Apr 29, 2001
Posts: 6
...I found out that the headers display if I drop the table in a JScrollPane. How do I get them to display without a JScrollPane? Any ideas?
Thomas Suer
Ranch Hand

Joined: Sep 03, 2001
Posts: 50
Try this site out:
http://www2.gol.com/users/tame/swing/examples/SwingExamples.html
Tom
 
GeeCON Prague 2014
 
subject: JTable column headers in 1.3