// Decompiled by Jad v1.5.7. Copyright 1997-99 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   JBorderlessButton.java

package com.symantec.itools.javax.swing;

import java.awt.Component;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.*;

public class JBorderlessButton extends JButton
    implements MouseListener
{

    public JBorderlessButton()
    {
        setBorderPainted(false);
        addMouseListener(this);
    }

    public JBorderlessButton(Icon icon)
    {
        super(icon);
        setBorderPainted(false);
        addMouseListener(this);
    }

    public JBorderlessButton(String s)
    {
        super(s);
        setBorderPainted(false);
        addMouseListener(this);
    }

    public JBorderlessButton(String s, Icon icon)
    {
        super(s, icon);
        setBorderPainted(false);
        addMouseListener(this);
    }

    public void setEnabled(boolean flag)
    {
        super.setEnabled(flag);
        if(!flag && isBorderPainted())
        {
            setBorderPainted(false);
            repaint();
        }
    }

    public boolean isFocusTraversable()
    {
        return false;
    }

    public boolean hasFocus()
    {
        return false;
    }

    public void mouseEntered(MouseEvent mouseevent)
    {
        if(!isBorderPainted() && isEnabled())
        {
            setBorderPainted(true);
            repaint();
        }
    }

    public void mouseExited(MouseEvent mouseevent)
    {
        if(isBorderPainted())
        {
            setBorderPainted(false);
            repaint();
        }
    }

    public void mouseClicked(MouseEvent mouseevent)
    {
    }

    public void mousePressed(MouseEvent mouseevent)
    {
    }

    public void mouseReleased(MouseEvent mouseevent)
    {
    }
}
