File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes printing a JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "printing a JTable" Watch "printing a JTable" New topic
Author

printing a JTable

Jhedzkie Skies
Ranch Hand

Joined: Oct 28, 2009
Posts: 118
hi there guys...

i came up with another thing that hinders my way into finishing my project.. >_>

i need to print the JTable rows and cols..

well, i mean, i have a JTable and its components. then i want to print it, or at least, print preview it..
it aims to be like this one....



i tried to study the API but i guess i really am still lacking at some things in java..
helps please...
santhosh varala kumar
Greenhorn

Joined: Nov 05, 2009
Posts: 25
By using
a) javax.print API
b) java.awt.paint
c) javax.swing.RepaintManager
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

Have you gone through the examples given here http://java.sun.com/docs/books/tutorial/uiswing/misc/printtable.html


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Jhedzkie Skies
Ranch Hand

Joined: Oct 28, 2009
Posts: 118
Maneesh Godbole wrote:Have you gone through the examples given here http://java.sun.com/docs/books/tutorial/uiswing/misc/printtable.html


oh! thanks. I missed this one. :O
Jhedzkie Skies
Ranch Hand

Joined: Oct 28, 2009
Posts: 118
ok, i read some of the codes, and i am lead up to this.. and it has an error..



it cant find JPrintPreviewPane anywhere.. :O
help please...
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19718
    
  20

Where did you get that class from?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
Consider Paul's rocket mass heater.
 
subject: printing a JTable