我搜索并搜索并查看了飞碟演示和浏览器中的代码。我不明白为什么这不起作用。
它应该显示 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 加载它,它给了我相同的输出。它快把我逼疯了。有人遇到过这个问题吗?