Class JPanelSizeToDocument

java.lang.Object
JPanelSizeToDocument

public class JPanelSizeToDocument extends Object
This example shows how to render a document as a Swing JPanel (XHTMLPanel, a subclass) and have the render engine figure out the document size for you; the frame containing the panel is then sized to the document size. To run this sample from the command line, make sure you have the Flying Saucer JARs in the classpath; arguments to the program are a URL or file path, and optionally, a target width for the document (width defaults to 800 otherwise): java -jar core-renderer.jar JPanelSizeToDocument myHtml.html 1024
  • Field Details

    • fileName

      private String fileName
    • targetWidth

      private int targetWidth
  • Constructor Details

    • JPanelSizeToDocument

      public JPanelSizeToDocument()
  • Method Details

    • main

      public static void main(String[] args)
    • run

      private void run(String[] args)
    • launchGUI

      private void launchGUI()
    • loadAndCheckArgs

      private void loadAndCheckArgs(String[] args)
    • messageAndExit

      private void messageAndExit(String msg)