private void draw()
    {
        GreenfootImage pic = new GreenfootImage((int)size.getX(), (int)size.getY());
        if (hover)
            pic.setColor(hoverColor);
        else
            pic.setColor(backColor);
        pic.fill();
        
        if (!enabled)
            pic.setColor(disableColor);
        else
            pic.setColor(textColor);
        
        pic.setFont(new Font("Times-Roman", Font.PLAIN, 12));
        Graphics2D g = pic.getAwtImage().createGraphics();
        g.setFont(pic.getFont());
        FontMetrics fm = g.getFontMetrics();
        pic.drawString(text, ((int)size.getX() - fm.charsWidth(text.toCharArray(), 0, text.length())) / 2 + (size.getX() % 2 == 0 ? 0 : 1), ((int)size.getY() + pic.getFont().getSize()) / 2 - 1);
        g.dispose();
        
        if (pressed)
            pic.setColor(pressColor);
        pic.drawRect(0, 0, (int)size.getX() - 1, (int)size.getY() - 1);
        if (iconVisible)
            pic.drawImage(icon, 3, 4);
        
        setImage(pic);
    }