
// Copyright (c) 2001 
package uk.co.patrickhaston.mars;

import javax.swing.*;
import java.awt.*;
import java.awt.Color;
import java.awt.Graphics;

/**
 * A Class class.
 * <P>
 * @author Patrick Haston
 */
public class navButton extends JButton
{

  /**
   * Constructs a new instance.
   */
  public navButton()
  {
    super();
    try
    {
      jbInit();
    }
    catch (Exception e)
    {
      e.printStackTrace();
      this.setBackground(Color.black);
      this.setForeground(Color.orange);
    }
  }

  /**
   * Constructs a new instance.
   */
  public navButton(String text)
  {
    super(text);
    try
    {
      jbInit();
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }
  /**
   * Initializes the state of this instance.
   */
  private void jbInit() throws Exception
  {
      this.setMargin(new Insets(0, 0, 0, 0));
    this.setPreferredSize(new Dimension(20,20) );
    this.setBorderPainted(false);
    //this.setFocusPainted(false);
    //this.setRolloverEnabled(false);
    //this.setBackground(Color.black);
    //this.setForeground(Color.black);
    this.setContentAreaFilled(false);

  }
  public void paint(Graphics g)
  {
    g.setColor(Color.darkGray);
    g.fillOval(0,0,this.getWidth(),this.getHeight());
    g.setColor(Color.yellow);
    g.drawString(this.getLabel(),this.getWidth()/3,this.getHeight()*2/3);
  }

}

 
