使用JTextPane打开一个网页
比如
<html>
<head> </head> <body>
<FORM name="ffc" action="1.jsp" method="POST"> <INPUT type="text" name="text1" value="12312">
<INPUT type="Submit" name="button3" value="submit" >
 
</FORM> </body>
</html>点击网页上的提交按钮后JTextPane会触发什么事件?
如何得到提交的数据?
比如
<html>
<head> </head> <body>
<FORM name="ffc" action="1.jsp" method="POST"> <INPUT type="text" name="text1" value="12312">
<INPUT type="Submit" name="button3" value="submit" >
 
</FORM> </body>
</html>点击网页上的提交按钮后JTextPane会触发什么事件?
如何得到提交的数据?
import java.awt.Dimension;
import java.awt.Toolkit;
import java.io.IOException;import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;public class T {
JFrame frame; int frame_w = 400; int frame_h = 300; public T() throws IOException {
frame = new JFrame(); JTextPane tp = new JTextPane();
tp
.setPage("file://localhost/D:/Pro/Temp/workspace/tiger/dic/html/MyHtml.html");
frame.getContentPane().add(new JScrollPane(tp), BorderLayout.CENTER); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(frame_w, frame_h);
Dimension scrsize = Toolkit.getDefaultToolkit().getScreenSize();
int frame_x = (scrsize.width - frame_w) / 2;
int frame_y = (scrsize.height - frame_h) / 2;
frame.setLocation(frame_x, frame_y);
frame.setVisible(true);
} public static void main(String[] args) throws IOException {
new T();
}
}