/** * The test class FilledOval. * * @author (your name) * @version (a version number or a date) */ import javax.swing.*; import java.awt.*; //provides access to Graphics public class FilledOval extends JComponent { int offset; public FilledOval(int x,int y, int w, int h,int offset) { super(); setBounds(x,y,w,h); this.offset = offset; } /* Postcondition: A filled oval is drawn with w the width of the rectangle and h as the height of the rectangle. Its upper-right hand corner has co-ordinates (x,y). */ public void paint(Graphics g) { g.setColor( getForeground()); g.fillOval(0,0,getWidth(),getHeight()); g.setColor(Color.black); char [] data = {'0','1','2','3','4','5','6','7','8','9','A','B','C', 'D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S', 'T','U','V','W','X','Y','Z'}; g.drawChars(data,offset,1,8,13); } }