问题阿,弱智问题阿 在页面里写个html按钮,用javascript关闭浏览器就是了! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 但是页面里面怎么写html文件呢? System.exit(0);同时还要进行安全验证 你这样做吧:applet 代码:(CloseIE.java)===============================================================================import java.applet.*;import java.awt.*;import java.awt.event.*;import java.net.*;public class CloseIE extends Applet { public Button closeButton = new Button("Close"); public void init() { this.setLayout(null); closeButton.setBounds(30, 40, 60, 20); closeButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { close(); } }); this.add(closeButton); } public void close() { try { this.getAppletContext().showDocument(new URL(this.getCodeBase() + "1.html"), "main"); } catch(MalformedURLException e) { System.out.println("error"); } }}CloseIE.html文件===========================================================================<html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK"><title>Close Test</title></head><body><iframe name="main" height=0></iframe><p align=center><BR><applet codebase = "." code = "CloseIE.class" width = "120" height = "100" hspace = "0" vspace = "0" align = "middle"></applet></body></html>1.html文件===========================================================================<html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK"><title>Close Test</title></head><body><p align=center><script language="javascript"> parent.opener = null; parent.close();</script><BR>test!!</body></html>放同一目录,编译后运行CloseIE.html readobject 报错 如何新开一个打印窗口? java与cgi通信问题 <img src="" usemap=""> 条形码问题,请教各位... RetroGuard 混淆器的用法! 代码格式化问题? 清哪位高手帮我调试一段java代码 关于java栈的数据共享问题 百度地图的JS API中有判断一个经纬度是否在一个区域中,求对应JAVA代码 很急的问题!! 帮帮忙! 散分! 打印十六进制
同时还要进行安全验证
===============================================================================
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;public class CloseIE extends Applet {
public Button closeButton = new Button("Close");
public void init() {
this.setLayout(null);
closeButton.setBounds(30, 40, 60, 20);
closeButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
close();
}
});
this.add(closeButton);
}
public void close() {
try {
this.getAppletContext().showDocument(new URL(this.getCodeBase()
+ "1.html"), "main");
}
catch(MalformedURLException e) {
System.out.println("error");
}
}
}CloseIE.html文件
===========================================================================
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>
Close Test
</title>
</head>
<body>
<iframe name="main" height=0></iframe>
<p align=center>
<BR>
<applet
codebase = "."
code = "CloseIE.class"
width = "120"
height = "100"
hspace = "0"
vspace = "0"
align = "middle"
>
</applet>
</body>
</html>1.html文件
===========================================================================
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>
Close Test
</title>
</head>
<body>
<p align=center>
<script language="javascript">
parent.opener = null;
parent.close();
</script>
<BR>
test!!
</body>
</html>放同一目录,编译后运行CloseIE.html