import java.awt.*;
class ecrire extends Frame
{
ecrire()
{
int i;
setTitle("Chiffres");
resize(200,200);
setLayout(new GridLayout(3,3));
for (i = 1;i <= 9;i ++)
add (new Button(String.valueOf(i)));
}
public boolean action(Event e,Object arg)
{
System.out.println(arg);
return (true);
}
public boolean handleEvent(Event e)
{
if (e.id == Event.WINDOW_DESTROY)
{
dispose();
System.exit(0);
}
return (super.handleEvent(e));
}
public static void main(String[] arg)
{
ecrire ec = new ecrire();
ec.show();
}
}
Retour