0% found this document useful (0 votes)
10 views

AWT Program For FileDialog

Uploaded by

PRABHAKAR MORE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

AWT Program For FileDialog

Uploaded by

PRABHAKAR MORE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

// AWT Program for FileDialog

import java.awt.*;
import java.awt.event.*;

public class Myclass extends Frame implements ActionListener


{
Button b,b2;

Myclass()
{
setLayout(new FlowLayout());
b=new Button("ok");
b2=new Button("cancel");

add(b);
b.addActionListener(this);
b2.addActionListener(this);
}

public void actionPerformed(ActionEvent e)


{
if(e.getSource()==b)
{
FileDialog d=new FileDialog(new Myclass(),"Mydialog",FileDialog.SAVE);

d.setVisible(true);
}

public static void main(String args[])


{
Myclass m=new Myclass();
m.setSize(500,500);
m.setVisible(true);

You might also like