PPT Slide
class GlassCover extends Component {
Color color = Color.yellow.darker();
String strMsg = "Click Here";
public void setColor(Color color){this.color=color;}
public Color getColor(){ return color; }
public void paint(Graphics g){
g.fillOval(0,0,getParent().getSize().width,
getParent().getSize().height);
g.setFont (new Font("Monospaced", Font.BOLD, 16));
FontMetrics fm = g.getFontMetrics();
(getParent().getSize().width
- fm.stringWidth(strMsg))/2,
getParent().getSize().height/2);
public Dimension getPreferredSize(){
return new Dimension(getParent().getSize());
public static void main(String arg[]){
new GlassExample().show();