import javax.microedition.lcdui.*; public class Area{ int x; int y; int w; int h; String text; int r = 0; int g = 0; int b = 0; public Area(int width, int height, String t){ w = width; h = height; text = t; } public void setPosition(int posx, int posy){ x = posx; y = posy; } public boolean press(int prx, int pry){ if (prx > x && prx < x+ w && pry > y && pry < y+ h){ return true; } else { return false; } } public boolean drag(int drx, int dry){ if (drx > x && drx < x+ w && dry > y && dry < y+ h){ return true; } else { return false; } } public boolean realis(int rlx, int rly){ if (rlx > x && rlx < x+ w && rly > y && rly < y+ h){ return true; } else { return false; } } public void draw(Graphics g){ g.setColor(r, g, b); g.fillRect(x, y, w, h); g.setColor(255,255,255); g.drawString(text, x+5,y+h-25,20); } public void color(int red, int green, int blue){ r = red; g = green; b = blue; } }