作者baelrog (魔)
看板java
标题[问题] 存档问题, 给我选又不给我用= =
时间Sat Jan 20 12:50:14 2007
我是一个java的初学者
现在正在写一个类似小画家的东西
在处理存档问题的时候碰到了一个我不知道问题在哪里的问题
在以下的两行里
painterSave psave = new painterSave();
psave.Save("D:\\test.txt", point, shapes, colors);
^^^^^
第二个save的地方会给我标红线
可是我在另外一个class里面的确有Save这个public void
而且当我打完psave按下.的时候
我用的Jbuilder的下拉式选单还有那个选项给我按
我另外一个叫painterSave的class在下面
我目前的目的是先在D槽上存一个空白的txt档
这个成功後我才打算把我的point, shapes, colors
做成string然後放到txt档里
问题可能很笨
请见谅
import java.io.*;
import java.awt.Point;
public class painterSave
{
public painterSave()
{
}
public void Save(String filename, painterFrame point[],
painterFrame shapes[], painterFrame colors[])
{
File file1 = new File( filename );
try
{
FileOutputStream fout = new FileOutputStream(file1);
this.Save( fout, point, shapes, colors);
}
catch (IOException ex) {}
} /* end of procedure variation_manager::Save */
public void Save(FileOutputStream fout, painterFrame point[],
painterFrame shapes[], painterFrame colors[])
{
try {
int tcount = point.length +1;
String st;
String total = "";
for (int i = 0; i < tcount; ++i)
{
fout.write(total.getBytes());
}
}
catch (IOException ex)
{
System.err.print(ex.toString());
}//end of try
}
}
--
当你把你丹田内的空气加压到5个大气压
从你嘴里喷出的气流就可以达到1500m/s
相当於5倍音速
而这......就是嘴炮的奥义
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 203.70.99.125