import java.applet.*; import java.awt.*; public class apleto14 extends Applet { Rectangle r = new Rectangle(10,30,20,20); boolean ene; String t = new String(""); TextField T = new TextField(t, 5); public void init() { add(T); } public void paint(Graphics g) { g.setColor(Color.black); g.fillRect(r.x,r.y,r.width,r.height); } public boolean mouseDown(Event evt, int x, int y) { ene =(r.inside(x,y)) ? true : false; if (ene) { t="Jes"; T.setText(t); } return true; } public boolean mouseUp(Event evt, int x, int y) { t="Ne"; T.setText(t); return true; } }