// Sample code file: NonFocusButton.java

// Warning: This code has been marked up for HTML

/*
   Copyright (c) 2000 Novell, Inc.  All Rights Reserved.

   THIS WORK IS SUBJECT TO U.S. AND INTERNATIONAL COPYRIGHT LAWS AND TREATIES. 
   USE AND REDISTRIBUTION OF THIS WORK IS SUBJECT TO THE LICENSE AGREEMENT 
   ACCOMPANYING THE SOFTWARE DEVELOPMENT KIT (SDK) THAT CONTAINS THIS WORK. 
   PURSUANT TO THE SDK LICENSE AGREEMENT, NOVELL HEREBY GRANTS TO DEVELOPER A 
   ROYALTY-FREE, NON-EXCLUSIVE LICENSE TO INCLUDE NOVELL'S SAMPLE CODE IN ITS 
   PRODUCT. NOVELL GRANTS DEVELOPER WORLDWIDE DISTRIBUTION RIGHTS TO MARKET, 
   DISTRIBUTE, OR SELL NOVELL'S SAMPLE CODE AS A COMPONENT OF DEVELOPER'S 
   PRODUCTS. NOVELL SHALL HAVE NO OBLIGATIONS TO DEVELOPER OR DEVELOPER'S 
   CUSTOMERS WITH RESPECT TO THIS CODE. 
*/
 


package com.novell.Chat;

//Java imports
import javax.swing.*;

/**
 * Creates a button that can not receive the focus. 
 * Good for toolbar buttons in ConsoleOne.
 */
class NonFocusButton extends JButton
{
    /**
     * Constructor
     */
    NonFocusButton()
    {
        super();
        setFocusPainted(false);
    }

    /**
     * Constructor
     *
     * @param icon The icon to place on the button.
     */
    NonFocusButton(Icon icon)
    {
        super(icon);
        setFocusPainted(false);
    }
    
    /**
     * Identifies whether or not this component can receive 
     * the focus.
     *
     * @return true if this component can receive the focus
     */
    public boolean isFocusTraversable()
    {
        return false;
    }
}