• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

JTable column headers in 1.3

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...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?
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this site out:
http://www2.gol.com/users/tame/swing/examples/SwingExamples.html
Tom
 
Let me tell you a story about a man named Jed. He made this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic