i tried the following code but not getting the desired output. I need to extend Applet class along with dialog class.how do i do that?
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*<applet code="YesNoDialog" width=400 height=400></applet>*/
public class YesNoDialog extends Dialog implements ActionListener
{
private Button yes=new Button("Yes");
private Button no=new Button("No");
public YesNoDialog(Frame parent,String message)
{
super(parent,true);
this.add(BorderLayout.CENTER,new Label(message));
Panel p=new Panel();
p.setLayout(new FlowLayout());
yes.addActionListener(this);
p.add(yes);
no.addActionListener(this);
p.add(no);
this.add(BorderLayout.SOUTH,p);
this.setSize(300,100);
this.setLocation(100,200);
this.pack();
}
public void actionPerformed(ActionEvent evt)
{
this.hide();
this.dispose();
}
}