1
public class A
{
    public  static void Main()
    {
        JTable t1 = new jTable();
        JTable t2 = new jTable();
        t1.print();
        t2.print();
    }
}

I have 5 JTables which I have to print 1 after the other on a single page. Please help me out with this

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user1760166
  • 89
  • 2
  • 8
  • Add your tables to one `JPanel` and then read [here](http://stackoverflow.com/a/750462/2894369) how to print whole swing component(`JPanel` in your case). – alex2410 Jan 09 '14 at 07:56

1 Answers1

0

To print more than one JTable on a single page you cannot directly use JTable.print(). You can either put the tables in a JPanel and print the entire JPanel, or manually print the tables using this code: http://hotcoding.crombz.com/2013/04/printing-multiple-printables-in-java.html

BioRoy
  • 375
  • 1
  • 3
  • 10