Re: Implementing a Dialog
Hi mehdi,
Here is the code for ur question:
// OpenDialog is the name of the menuitem
// this is a inner class within ur class derived from frame
class SymAction implements java.awt.event.ActionListener
{
public void actionPerformed(java.awt.event.ActionEvent event)
{
Object object = event.getSource();
if (object == OpenDilaog)
OpenDilaog_Action(event);
}
}
void OpenDilaog_Action(java.awt.event.ActionEvent event)
{
// to do: code goes here.
// this refers to the frame
// the class u derived from Frame
Dialog d = new Dialog(this,"Ur Dialog",true);
// try using setSize if needed.
d.resize(100,100);
d.show();
}
// for any further details contact me at [email protected]