Latest News

 










Applet : A first Example

Previous slide Next slide Back to first slide View graphic version


Applet : A first Example


 
My other sites

Latest News

 










Applet : A first Example

    public void paint(Graphics g) {
    // draw the black border of rectangle.
    g.setColor(Color.black);
    g.drawRect(9, 9, 332, 102);
    g.drawRect(8, 8, 334, 104);
    g.drawRect(7, 7, 336, 106);
    // lightgray rectangle
    g.setColor(Color.lightGray);
    g.fillRect(10, 10, 330, 100);
    // set the Helvetica font
    g.setFont(myFont);
    // draw the shadow of the text
    g.setColor(Color.gray);
    g.drawString(message, 40, 75);
    // draw the text
    g.setColor(Color.black);
    g.drawString(message, 37, 72);
    }
    } // end class

Previous slide Next slide Back to first slide View graphic version