001/* ----------------------------------------------------------------------------
002   The Kiwi Toolkit - A Java Class Library
003   Copyright (C) 1998-2004 Mark A. Lindner
004
005   This library is free software; you can redistribute it and/or
006   modify it under the terms of the GNU General Public License as
007   published by the Free Software Foundation; either version 2 of the
008   License, or (at your option) any later version.
009
010   This library is distributed in the hope that it will be useful,
011   but WITHOUT ANY WARRANTY; without even the implied warranty of
012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013   General Public License for more details.
014
015   You should have received a copy of the GNU General Public License
016   along with this library; if not, write to the Free Software
017   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
018   02111-1307, USA.
019 
020   The author may be contacted at: mark_a_lindner@yahoo.com
021   ----------------------------------------------------------------------------
022   $Log: KButton.java,v $
023   Revision 1.7  2004/05/12 18:21:20  markl
024   comment block updates
025
026   Revision 1.6  2004/03/20 05:14:47  markl
027   code cleanup
028
029   Revision 1.5  2004/03/15 06:16:31  markl
030   Cosmetic fixes to make KButtons toolbar-friendly.
031
032   Revision 1.4  2003/01/19 09:50:53  markl
033   Javadoc & comment header updates.
034
035   Revision 1.3  2001/03/12 09:27:56  markl
036   Source code and Javadoc cleanup.
037
038   Revision 1.2  1999/01/10 02:25:57  markl
039   added GPL header & RCS tag
040   ----------------------------------------------------------------------------
041*/
042
043package kiwi.ui;
044
045import javax.swing.*;
046
047import kiwi.util.KiwiUtils;
048
049/** A trivial extension to <code>JButton</code> that performs some simple
050  * customizations.
051  *
052  * @see javax.swing.JButton
053  *
054  * @author Mark Lindner
055  */
056
057public class KButton extends JButton
058  {
059  
060  /** Construct a new <code>KButton</code>. A new, transparent button will be
061    * created.
062    *
063    * @param text The text to display in the button.
064    */
065
066  public KButton(String text)
067    {
068    super(text);
069    _init();
070    }
071
072  /** Construct a new <code>KButton</code>. A new, transparent button will be
073    * created.
074    *
075    * @param text The text to display in the button.
076    * @param icon The icon to display in the button.
077    */
078
079  public KButton(String text, Icon icon)
080    {
081    super(text, icon);
082    _init();
083    }
084
085  /** Construct a new <code>KButton</code>. A new, transparent button will be
086    * created.
087    *
088    * @param icon The icon to display in the button.
089    */
090
091  public KButton(Icon icon)
092    {
093    super(icon);
094    _init();
095    }
096
097  /*
098   */
099
100  private void _init()
101    {
102    setOpaque(!UIChangeManager.getInstance().getButtonsAreTransparent());
103    }
104  
105  }
106
107/* end of source file */