import java.awt.*;
public class Main extends Frame{
Label statusBar=new Label();
Main(){
Super("Example");
add("South",StatusBar);
resize(200,200);
show();
}
public boolean handleEvent(Event evt){
swith(evt.id){
case Event.MOUSE_MOVE:
return mouseMove(evt,evt.x,evt.y);
case Event.MOUSE_DRAG:
return mouseDrag(evt,evt.x,evt.y);
case Event.WINDOW_DESTROY:
hide();
dispose();
System.exit(0);
return true;
}
return super.handleEvent(evt);
}
public boolean mouseDrag(Event evt,int x,int y
{String status="("+evt.x+","+evt.y+")";
if(evt.controlDown())status+="C";
if(evt.shiftDown())status+="S";
statusBar.setText(status);
rerurn true;
}
static public void main(String[] args){
new Main();
}
}