package chapter15;import java.io.IOException;
import javax.swing.event.*;
import javax.swing.*;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.event.HyperlinkEvent;class LinkFollower implements HyperlinkListener{
private JEditorPane jep;
public LinkFollower(JEditorPane jep){
this.jep=jep;
}
public void hyperlinkUpdate(HyperlinkEvent he){
//重写HyperlinkListener接口中的hyperlinkUpdate()方法
if(he.getEventType()==HyperlinkEvent.EventType.ACTIVATED){
try {
//如果事件类型等于激活类型
jep.setPage(he.getURL());    //设置当前要显示的URL
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
}
}
public class Browser { //private static final String WindowMessage = null; /**
 * @param args
 */
public static void main(String[] args) {
// TODO Auto-generated method stub
String initPage="http://www.baidu.com";//设置浏览器默认显示的页面
if(args.length>0){
initPage=args[0]; //为浏览器指定要显示的页面
JEditorPane jep=new JEditorPane();//创建一个JEditorPane类的对象
jep.setEditable(false);//将文本组建设置为不可编辑状态
jep.addHyperlinkListener(new LinkFollower(jep)); //添加一个超链接侦听器

try {
jep.setPage(initPage);//设置当前要显示的URL
} catch (IOException e) {
// TODO: handle exception
e.printStackTrace();
}
JScrollPane jsp=new JScrollPane(jep);
JFrame jf=new JFrame("简单浏览器");
jf.setDefaultCloseOperation(WindowMessage.DISPOSE_ON_CLOSE);
jf.getContentPane().add(jsp);
jf.setSize(512,324);
jf.show();

} }}编译报错:
Exception in thread "main" java.lang.Error: 无法解析的编译问题:
WindowMessage cannot be resolved to a variable at chapter15.Browser.main(Browser.java:52)求指点。