2021. 5. 21. 15:11ㆍ카테고리 없음
Package javax.swing Description Provides a set of 'lightweight' (all-Java language) components that, to the maximum degree possible, work the same on all platforms. For a programmer's guide to using these components, see Creating a GUI with JFC/Swing, a trail in The Java Tutorial. Java Swing Tutorial. Java Swing tutorial is a part of Java Foundation Classes (JFC) that is used to create window-based applications.It is built on the top of AWT (Abstract Windowing Toolkit) API and entirely written in java. Unlike AWT, Java Swing provides platform-independent and lightweight components. Swing is written in 100% java. Swing is a part of JFC, Java Foundation Classes. It is a collection of packages for creating full featured desktop applications. JFC consists of AWT, Swing, Accessibility, Java 2D, and Drag and Drop. Swing was released in 1997 with JDK 1.2. It is a mature toolkit.
Also known as The Swing Tutorial. This trail tells you how to create graphical user interfaces (GUIs) for applications and applets, using the Swing components. If you would like to incorporate JavaFX into your Swing application, please see Integrating JavaFX into Swing Applications. Getting Started with Swing is a quick start lesson. PDF Clown for Java (PDF Jester) is a Java 1.5 library for reading, manipulating and writing PDF files, with multiple abstraction layers to satisfy different programming styles: from the lower level (PDF object model) to the higher (PDF document structure and content streaming). – Maps Java code to each operating system's real GUI system – Problems: Limited to lowest common denominator (limited set of UI widgets); clunky to use. Advice: Use Swing. You occasionally have to use AWT (Swing is built on top of AWT). Beware: it’s easy to get them mixed up.
Possible Duplicate:
PDF Generation Library for Java
I'm working on an invoice program for a local accounting company.What is a good way to create a PDF file with Java? Any good library?I'm totally new to PDF export (On any language).
lakshmanmarked as duplicate by trashgod, Shog9♦Sep 23 '11 at 18:01
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
3 Answers
I prefer outputting my data into XML (using Castor, XStream or JAXB), then transforming it using a XSLT stylesheet into XSL-FO and render that with Apache FOP into PDF. Worked so far for 10-page reports and 400-page manuals. I found this more flexible and stylable than generating PDFs in code using iText.
Philipp ReichartPhilipp ReichartFollowing are few libraries to create PDF with Java:
I have used iText for genarating PDF's with a little bit of pain in the past.
Or you can try using FOP: FOP is an XSL formatter written in Java. It is used in conjunction with an XSLT transformation engine to format XML documents into PDF.
LiiAnother alternative would be JasperReports: JasperReports Library. It uses iText itself and is more than a PDF library you asked for, but if it fits your needs I'd go for it.
Simply put, it allows you to design reports that can be filled during runtime. If you use a custom datasource, you might be able to integrate JasperReports easily into the existing system. It would save you the whole layouting troubles, e.g. when invoices span over more sites where each side should have a footer and so on.
pudaykiran