当前位置: 技术问答>java相关
GUI问题:如何使用文件选择对话框保存文本文件,图像文件??
来源: 互联网 发布时间:2015-06-19
本文导语: ..... private void saveFile(){ JFileChooser chooser = new JFilerChooser(); int result = chooser.showSaveDialog(this); if (result==JFileChooser.CANCEL_OPTION) return; //已创建一个Image对象i和t...
.....
private void saveFile(){
JFileChooser chooser = new JFilerChooser();
int result = chooser.showSaveDialog(this);
if (result==JFileChooser.CANCEL_OPTION)
return;
//已创建一个Image对象i和textpane,如何将他们保存
....
}
private void saveFile(){
JFileChooser chooser = new JFilerChooser();
int result = chooser.showSaveDialog(this);
if (result==JFileChooser.CANCEL_OPTION)
return;
//已创建一个Image对象i和textpane,如何将他们保存
....
}
|
如何写一个buffered image到文件中??
BufferedImage bi;
File f = new File("c:imagesmyimage.png");
ImageIO.write(im, "png", f);
after jdk1.4
BufferedImage bi;
File f = new File("c:imagesmyimage.png");
ImageIO.write(im, "png", f);
after jdk1.4