Reputation: 363
Requirement Description:
(1) I designed a UI with Java Swing Components which contains JTextFiled, JLabel, and JTable.
(2) The JTable was wrapped in a JScrollPanel due to UI size limitation.
Problem:
I wanna print the all the components with a "PRINT" button. But I am stuck by the JTable with the case that there are some rows in the talbe cannot be visible(which cannot be printed).
So what should I do about the JTable, or there is another way to print the whole components?
Thanks advanced, really appreciate your help!
Upvotes: 1
Views: 968
Reputation: 51445
You don't want to print the UI. You want to print the contents of the JTable
.
The JTable
has an API for printing. This tutorial might help: How to Print Tables
Upvotes: 3