import java.awt.*;
import javax.swing.*;
public class Abc extends Dialog
{
private Button button;
private Checkbox ACTIVE;
public Abc(Frame parent)
{
super(parent,"lock", false);
setLayout(new BorderLayout(15,50));
setResizable(false);
Panel lab = new Panel();
lab.setLayout(new GridLayout(5,30));
add("Center", lab);
button = new Button("OK");
ACTIVE = new Checkbox("Mark");
boolean active;
Panel p = new Panel();
p.setLayout(new FlowLayout(FlowLayout.CENTER, 10, 10));
p.add(ACTIVE);
add("East",p);
p.add(button);
add("East",p);
ACTIVE.setState(false);
pack();
Point fatherLocation = parent.location();
move(fatherLocation.x + 150,fatherLocation.y + 200);
show();
}
public boolean action (Event evt, Object arg)
{
if (evt.target instanceof Button)
{
if(evt.target == button)
{
hide();
dispose();
return true;
}
else if(evt.target== ACTIVE)
{
// Here i want to check
}
}
return false;
}
public boolean handleEvent (Event event)
{
switch (event.id) {
case Event.WINDOW_DESTROY:
dispose();
return true;
default:
return super.handleEvent(event);
}
}
}