This tutorial shows how to create simple save File Chooser in java.For open file chooser see How To Create Open File Chooser In Java .Following are the steps for creating save file chooser in java.
SAVE FILE CHOOSER:
Creating of open file chooser requires two steps:
- JFileChooser save = new JFileChooser();
int option = open.showOpenDialog(this);
CODING:
import javax.swing.*;import java.awt.*;
class myjframe1 extends JFrame {
public myjframe1() {
setTitle("save FileChooser");
setSize(300, 200);
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
JFileChooser save = new JFileChooser();
int option = save.showSaveDialog(this);
}
}
class simpframe
{
public static void main(String args[])
{
myjframe1 x= new myjframe1();
}
}
how to do the textarea operation like save textarea info to text file cut, copy, past, save as txt file ..etc
ReplyDelete