First of all, you need an IDE , so you can ease manage your source code and import the library. i assume, you know how to import class library from IDE netbeans, just google it!!!.... :)
Ok, what does the library do??.... well, it can print your jTable component and preview the layout before you print them, ofcourse... i have add some function like zooming, import to image jpg and png extension capability. Check it out right now... :)
Here is step by step:
- Open up your netbeans ide, now create new form. Drag and drop component jTabel to your form.
- Add two button, first button for printing and second button for autoAdjustColumnWidth
- here is the screenshoot
The Source Code
Here is the screenshot when i run the code:
- When i click PrintPreviewJTable button i get this result
- When i click autoAdjustColumnWidth button i get this result
Any Question?..... just post it here.... see ya... :)
Well, it call's " Myg3nxTable " that does not exist in the project.
ReplyDeleteWithout it, it seems to me thar i can not try it.
Best regards, from, Alfredo Fernandes
the class Myg3nxTable is in the library, if you are using new netbean ide (ver. 7.x.x), you need to re-import the library to refresh the class.
ReplyDeletethe library is in the pathaddress classlibrary.printme.zip\printme\dist\lib\printpreview.jar
and the demo aplication is in the pathaddress classlibrary.printme.zip\printme\dist
i hope, this will help... :)
Thanks. but i cant organized table columns on A4 size.
ReplyDeletehow can i resize it?
what did you mean? i dont u nderstand... hmmm, did you mean to make long column to single page preview (a4 size) or change the paper to a4 size for printing (so long column will be split to next page)?...
DeleteFor this time, you cannot resize the column in preview layout... (well, that is my work todo list for future improvment... :))
thanks