FileDocCategorySizeDatePackage
TextBox3D.javaAPI DocExample1257Mon Mar 24 02:02:26 GMT 1997None

TextBox3D

public class TextBox3D extends Canvas

Fields Summary
String
text
Constructors Summary
public TextBox3D(String s, int width, int height)

        super();
        text=s;
        setSize(width, height);
    
Methods Summary
public synchronized voidpaint(java.awt.Graphics g)

        FontMetrics fm = g.getFontMetrics();
        Dimension size=getSize();
        int x = (size.width - fm.stringWidth(text))/2;
        int y = (size.height - fm.getHeight())/2;
        g.setColor (SystemColor.control);
        g.fillRect (0, 0, size.width, size.height);
        g.setColor (SystemColor.controlShadow);
        g.drawLine (0, 0, 0, size.height-1);
        g.drawLine (0, 0, size.width-1, 0);
        g.setColor (SystemColor.controlDkShadow);
        g.drawLine (0, size.height-1, size.width-1, size.height-1);
        g.drawLine (size.width-1, 0, size.width-1, size.height-1);
        g.setColor (SystemColor.controlText);
        g.drawString (text, x, y);