需要在窗体里嵌入网页,有这样的控件吗?小弟实在没分,多包涵,先谢过!
解决方案 »
- 关于Jtable 自动更新cell的问题
- wap页面防止刷新
- 怎么才能在JTable的单元格里添加数据呢,我想添加的是Properties文件里的数据。
- 怎么样才能跟踪程序代码的执行?? 谢谢
- 如何搜索linkedList含有"John"的对象?
- 请求帮助。。。
- 100分求救!请问谁做过具有"鹰眼"功能的图形界面程序
- 如何执行会返回数据集的存储过程?
- 学习lucene源码的疑问22222222222222222222222
- 你们看是不是可以这样理解:在用来进行两个对象的比较时,==操作符用来比较两个对象的引用地址,而equals()用来比较两个对象的值。
- jdbc与sql数据库的连接问题。
- 请教高手
那在html里的超链接和其它的按钮等功能是不是也能实现啊?
窗体源代码:
package Frame;import java.awt.Color;
import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import javax.swing.*;public class FrameOne extends JFrame {
public FrameOne() throws IOException{
JEditorPane EditorPane= new JEditorPane();
URL url = this.getClass().getResource("/Frame/help.html");
EditorPane.setEditable(false);
EditorPane.setPage(url);
this.add(EditorPane);
}
}
HTML源代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Index page!!!!</title>
</head>
<body>
<table width="200" border="1" align="center">
<tr>
<td align="center"><input type="button" value="请点击"/></td>
</tr>
<tr>
<td align="center"><input type="button" value="请点击"/></td>
</tr>
<tr>
<td align="center"><input type="button" value="请点击"/></td>
</tr>
</table>
<p><a href="test.html">111111111111</a></p>
</body>
</html>主函数源代码:
package Main;import java.io.IOException;
import Frame.FrameOne;public class MainTest {
public static void main(String[] args) throws IOException {
FrameOne fo = new FrameOne();
fo.setSize(new Dimension(800,600));
fo.setVisible(true);
}
}结果:
也可以用JNI内嵌一个IE浏览器,不过这会破坏Java程序移植性,除非只在Windows上运行。