GUI界面中使用输入输出流 怎么在GUI中,把从监听文本框获得的字符串,通过IO流写入一个文件中?我尝试把数据写入的动作放在监听class里,但是总是抛出异常,请前辈们指教谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 下面是监听程序代码class BL1 implements ActionListener { public void actionPerformed(ActionEvent e) throws IOException { String s1=""; String ss=""; int i2=0,i3=0; try { DataOutputStream out = new DataOutputStream( new BufferedOutputStream ( new FileOutputStream("Data.csv"))); out.writeBytes("4,2,3"); out.close(); }catch (EOFException x) { System.err.println("xxxxxxx"); } } }这下面是错误报告H:\java>javac MainFrame.java.\ChildFrame.java:35: ChildFrame.BL1 の actionPerformed(java.awt.event.ActionEvent) は java.awt.event.ActionListener の actionPerformed(java.awt.event.ActionEvent) を実装できません。オーバーライドされたメソッドは java.io.IOException をスローしません。 public void actionPerformed(ActionEvent e) throws IOException { ^エラー 1 個是什么问题啊 class BL1 extends AbstractAction { public void actionPerformed(ActionEvent e) { String s1 = ""; String ss = ""; int i2 = 0, i3 = 0; try { DataOutputStream out = new DataOutputStream( new BufferedOutputStream( new FileOutputStream("Data.csv"))); out.writeBytes("4,2,3"); out.close(); } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } }} 怎么在一个标签上显示另一个标签 如何用JAVAScript网页上实现,两次密码输入是否一致?? 泛型类的嵌套 JTextArea 添加监听的问题 求注释1句java计算器代码 只有一句话 谢谢了 指定上网 如何开发能显示数学符号的TextArea或EditorPane? test ResourceBundle 的问题?高手请赐教!!! 如何一个独立的窗口始终位于桌面的最上层? JBuilder中有没有那种可以多选的下拉列表框 请教关于“java内部类”???
class BL1 implements ActionListener {
public void actionPerformed(ActionEvent e) throws IOException {
String s1="";
String ss="";
int i2=0,i3=0;
try {
DataOutputStream out =
new DataOutputStream(
new BufferedOutputStream (
new FileOutputStream("Data.csv")));
out.writeBytes("4,2,3");
out.close();
}catch (EOFException x) {
System.err.println("xxxxxxx");
}
}
}
这下面是错误报告H:\java>javac MainFrame.java
.\ChildFrame.java:35: ChildFrame.BL1 の actionPerformed(java.awt.event.ActionEve
nt) は java.awt.event.ActionListener の actionPerformed(java.awt.event.ActionEve
nt) を実装できません。オーバーライドされたメソッドは java.io.IOException をスロ
ーしません。
public void actionPerformed(ActionEvent e) throws IOException {
^
エラー 1 個是什么问题啊
extends AbstractAction {
public void actionPerformed(ActionEvent e) {
String s1 = "";
String ss = "";
int i2 = 0, i3 = 0;
try {
DataOutputStream out =
new DataOutputStream(
new BufferedOutputStream(
new FileOutputStream("Data.csv")));
out.writeBytes("4,2,3");
out.close();
}
catch (FileNotFoundException ex) {
ex.printStackTrace();
}
catch (IOException ex) {
ex.printStackTrace();
}
}
}