Flying Saucer 无法很好地渲染页面(并输出 CSS)!
我搜索、搜索、查看来自 Flying Saucer 演示和浏览器的代码。我不明白为什么这不起作用。
它应该显示report.html 演示。这是它显示的内容: http://i55.tinypic.com/288v807.png
我是在小程序中使用飞碟。 我的配置文件与演示浏览器完全相同,并且加载正确。
// this variable contains the xml
contentFileString = "..";
ScalableXHTMLPanel view = new ScalableXHTMLPanel();
view.setCenteredPagedView(true);
view.setBackground(Color.WHITE);
int text_width = 200;
view.setPreferredSize(new Dimension(text_width, text_width));
Document document = XMLResource.load(new StringReader(contentFileString)).getDocument();
view.setDocument(document);
// .. render the frame
FSScrollPane scroll = new FSScrollPane(view);
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(scroll, BorderLayout.CENTER);
frame.pack();
frame.setSize(700, 600);
frame.setVisible(true);
你可以说是从文件加载FS。我已经尝试从 URI 加载它,它给了我相同的输出。这让我发疯。有人遇到过这个问题吗?
I searched and searched and looked at the code from Flying Saucer demos and browser. I cannot understand why this does not work.
It should display the report.html demo. This is what it displays: http://i55.tinypic.com/288v807.png
I am using Flying Saucer inside an applet.
My configuration file is exactly the same as the demo browser and it's loaded correctly.
// this variable contains the xml
contentFileString = "..";
ScalableXHTMLPanel view = new ScalableXHTMLPanel();
view.setCenteredPagedView(true);
view.setBackground(Color.WHITE);
int text_width = 200;
view.setPreferredSize(new Dimension(text_width, text_width));
Document document = XMLResource.load(new StringReader(contentFileString)).getDocument();
view.setDocument(document);
// .. render the frame
FSScrollPane scroll = new FSScrollPane(view);
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(scroll, BorderLayout.CENTER);
frame.pack();
frame.setSize(700, 600);
frame.setVisible(true);
You could say its from loading FS from the document. I already tried loading it from an URI and it gives me the same output. It's driving me insane. Has anybody had this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
仔细听我说:不要使用 core-renderer-minimal.jar
这是最愚蠢的错误之一。就这样,使用 core-renderer.jar 就可以了。
Listen to me carefully: DO NOT use the core-renderer-minimal.jar
This was one of the most stupid errors. Just that, use the core-renderer.jar and you're good to go.