hi all
i am learning beginners
java. i am facing problem with file Dialog class. Following program show the dialog box but i can't open any file or save any file from it. in order to save and open a file which methods can i use in this program? I tried FileDialog.LOAD and FileDialog.Save.This doesn't show any error but does not work.please help me
Regards
Smriti Singla
.................................................................
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
class sampleframe extends Frame
{
sampleframe(
String title)
{
super(title);
MyWindowAdapter ad=new MyWindowAdapter(this);
addWindowListener(ad);
}
}
class MyWindowAdapter extends WindowAdapter
{
sampleframe ss;
public MyWindowAdapter(sampleframe ss)
{
this.ss=ss;
}
public void windowClosing(WindowEvent we)
{
ss.setVisible(false);
}
}
public class filedialog
{
public static void main(String args[])
{
Frame f=new sampleframe("file dialog box");
f.setVisible(true);
f.setSize(100,100);
FileDialog fd=new FileDialog(f,"filedialog",FileDialog.LOAD);
fd.setVisible(true);
}
}