高手进啊啊~~~

shuaiyuyu shuaiyuyu 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我想的是使用TOOLBAR做的浏览器的地址拦~
我想在地址拦上输入网址,然后在JEditorPane里显示相应的网页~
但是怎么我回车后没反映啊??
JEditorPane类有没有刷新的方法啊?
急.....
高手帮下忙!!!
下面编译没错~我扩展的TOOLBAR类~JEditorPane当参数传过来的~~帮忙看下哈~
public class Toolbar1 extends JToolBar implements ActionListener{
JComboBox dzhi;
JLabel l1;
JEditorPane ep;
Toolbar1(JEditorPane ep){
this.ep=ep;
l1=new JLabel("地址(D): ");
dzhi=new JComboBox();
dzhi.setEditable(true);
dzhi.addActionListener(this);
add(l1);add(dzhi);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==dzhi)
{
try {
ep.setPage("http://www.163.com");
}
catch (IOException el)
{
ep.setContentType("text/html");
ep.setText("找不到该网页");
}
catch (IllegalArgumentException ie) {}
}
}


}
...全文
评论
收藏 已收藏
分享
返回顶部
shuaiyuyu
Java SE 62,621 成员 307,251 内容