erer.flying-saucer-examples.9.9.4.source-code.QuotingExample Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of flying-saucer-examples Show documentation
Show all versions of flying-saucer-examples Show documentation
Misc. Flying Saucer example code. It is not deployed with a release.
import org.xhtmlrenderer.simple.XHTMLPanel;
import org.xhtmlrenderer.util.XMLUtil;
import javax.swing.*;
import static javax.swing.SwingUtilities.invokeLater;
public class QuotingExample extends JFrame {
//currently we cannot display different quotes based on depth
private static final String DOCUMENT =
"""
This is just a test of the emergency quoting
system.
This is only a test.
Thank you for your cooperation during this test.
""";
protected void frameInit() {
super.frameInit();
setTitle("CSS Quoting Example");
setDefaultCloseOperation(EXIT_ON_CLOSE);
XHTMLPanel xr = new XHTMLPanel();
try {
xr.setDocument(XMLUtil.documentFromString(DOCUMENT));
} catch (Exception e) {
throw new ExceptionInInitializerError(e);
}
add(xr);
setSize(500, 300);
}
public static void main(String[] args) {
invokeLater(() -> new QuotingExample().setVisible(true));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy