0
我在Java jframe中显示Google日历时遇到问题。在Java中显示Google日历JFrame
编辑:我看到谷歌日历,但它有一个蓝色的背景,它使得很难查看事件。
这里是我的代码
temp
是谷歌的用户名一snipit。
private void getGoogleCalendar(){
googlepane=new JPanel(new BorderLayout());
String s="https://www.google.com/calendar/b/0/[email protected]&ctz=America/New_York&gsessionid=OK";
JEditorPane tp=new JEditorPane();
try {
HTMLEditorKit kit = new HTMLEditorKit();
StyleSheet styles =kit.getStyleSheet();
styles.importStyleSheet(new URL(s));
kit.setStyleSheet(styles);
kit.install(tp);
tp.setContentType("text/html");
tp.setEditorKit(kit);
tp.addHyperlinkListener(this);
tp.setEditable(false);
tp.setPage(s);
tp.setBackground(Color.white);
} catch (IOException e) {
e.printStackTrace();
}
googlepane.add(tp, BorderLayout.CENTER);
return;
}
谷歌没有提供一个HTML唯一的版本: https://www.google.com/calendar/b/0/[email protected]om&ctz=America/New_York&gsessionid =确定 但它仍然无法正确显示。我不断收到错误导致:java.lang.ClassNotFoundException:org.eclipse.swt.SWT当我尝试使用Dj项目 – 2011-03-08 03:46:15
对不起,我误解了它。我添加了DJ Project的描述。 – 2011-03-08 05:44:59
我宁愿没有一个特定于操作系统的jar,JEditorPane不显示html页面,但它具有蓝色背景,而不是白色。 – 2011-03-08 06:06:53