import javax.swing.*;
public class fileChooser1 extends JFrame
{
public fileChooser1()
{
JFileChooser fc = new JFileChooser();
fc.setDialogTitle("Choose a file");
this.getContentPane().add(fc);
fc.setVisible(true);
}
public static void main(String surat[])
{
JFrame f = new fileChooser1();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.pack();
f.setVisible(true);
}
}
Output:
public class fileChooser1 extends JFrame
{
public fileChooser1()
{
JFileChooser fc = new JFileChooser();
fc.setDialogTitle("Choose a file");
this.getContentPane().add(fc);
fc.setVisible(true);
}
public static void main(String surat[])
{
JFrame f = new fileChooser1();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.pack();
f.setVisible(true);
}
}
Output:
No comments:
Post a Comment