我正在创建一个Web浏览器,我必须在其中呈现CSS . 现在我已经使用JEditorPane完成了HTML部分,但是我在尝试合并swingbox时遇到了麻烦 . 以下是我的代码
private JTextField addressBar;
private JEditorPane display;
private void load(String Url){
try {
display.setPage(Url);
addressBar.setText(Url);
BrowserPane swingbox = new BrowserPane();
// add the component to your GUI
display.add(swingbox);
// display the page
swingbox.setPage(Url);
} catch (IOException ex) {
Logger.getLogger(MiniBrowser.class.getName()).log(Level.SEVERE, null, ex);
}
}
它显示HTML但没有CSS . 以下是它在控制台上显示的错误:
SLF4J:无法加载类“org.slf4j.impl.StaticLoggerBinder” . SLF4J:默认为无操作(NOP) Logger 实现SLF4J:有关更多详细信息,请参阅http://www.slf4j.org/codes.html#StaticLoggerBinder .