Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem printing JPanel in JTable

 
Sheila Wallace
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a strange problem when pritning. I am printing a JTable by printong each table cell individually. In order to do this I call print(graphics) on the component within the table cell. One of the cells of the JTable contains a JPanel which contains 2 JLabels. No matter what I do, the JLabels within the JPanel will not print. The clip bounds passed to the component are correct as I can draw them ok. If I change the cell to contain only a JLabel it will print correctly, but as soon as I put it inside a JPanel the JLabel will not print.
Any ideas?
 
Eddie Vanda
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What layout manager are you using in your JPanel?
 
Sheila Wallace
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using BorderLayout but have tried changing it to FlowLayout, GridLayout etc and still no joy.
If you pass clip bounds to a Container, how does it translate those for it's children?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic