1

I want to print a Jpanel with two things in it.

  1. I have a Jtable that could have as many as 500 row in it, and I need to be able to print all of them.
  2. I have a JTextfield under the JTable in the JPanel.

I want to print both of these at the same time. The problem I am having is when I print the jtable it only prints the visible part. What I really care about is the content of the JTable and not the Table itself.

Edit: I use Netbeans to build my Gui so I don't really know how to display the code for the Panel, Table, and TextFields.

Here is a picture of the frame everything is in:enter image description here

The table can have more rows than you can see at once. All the items here except for the button are in a Jpanel, so I need to print this jpanel. What I have found and tried doesn't print all of the jtable, just what is visible to the user.

1 Answers1

0

When you call table.print() it will offer a dialog and you click print. I can't help you more until you post some code but this works for me.

Mitch Connor
  • 766
  • 10
  • 19
  • table.print() only prints what is visible and not the whole thing. This doesn't help me print the TextField also in the panel. – jacen.garriss Aug 13 '13 at 15:06
  • It may be a problem with your settign do you have the option selected to print all pages? – Mitch Connor Aug 13 '13 at 15:06
  • Well I would love to help but I need more information/code about you problem. – Mitch Connor Aug 13 '13 at 15:14
  • Ok if you don't understand where to find the code behind for generated GUI code then I have my doubts you are calling this function correctly, however, if there isn't actually data in the field of the table (regardless of the size) it will not print an empty table. – Mitch Connor Aug 13 '13 at 17:01
  • There is data I just removed for this photo. There is no need to display the data. – jacen.garriss Aug 13 '13 at 17:45