import java.applet.Applet; import java.awt.event.*; import java.awt.*; import java.awt.geom.*; /*This is a basic class for a rectangular integer entry button*/ public class SelectReal { double x,y,w,h; String S; int on; Font FONT; /*rectangle*/ public SelectReal(double x,double y,double w,double h,double val) { this.x=x; this.y=y; this.w=w; this.h=h; Double temp=new Double(val); S=temp.toString(); this.on=0; this.FONT=new Font("Helvetica",Font.PLAIN,11); } public int inside(Point p) { int test=0; if((p.x>x)&&(p.xy)&&(p.y10) S=S.substring(0,9); } public void modify(KeyEvent e) { if(e.getKeyChar()==KeyEvent.VK_BACK_SPACE) { int L=S.length(); if(L>0) S=S.substring(0,L-1); } else { char[] ch={e.getKeyChar()}; if(S.length()<10) S=S+new String(ch); } } }