/[schmitzm]/trunk/src/skrueger/swing/CancelButton.java
ViewVC logotype

Diff of /trunk/src/skrueger/swing/CancelButton.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 243 by mojays, Tue Feb 24 22:43:52 2009 UTC revision 244 by alfonx, Wed Jul 29 09:33:33 2009 UTC
# Line 1  Line 1 
1  package skrueger.swing;  /*******************************************************************************
2     * Copyright (c) 2009 Martin O. J. Schmitz.
3  import java.awt.Dimension;   *
4     * This file is part of the SCHMITZM library - a collection of utility
5  import javax.swing.Action;   * classes based on Java 1.6, focussing (not only) on Java Swing
6  import javax.swing.Icon;   * and the Geotools library.
7  import javax.swing.ImageIcon;   *
8  import javax.swing.JButton;   * The SCHMITZM project is hosted at:
9  /**   * http://wald.intevation.org/projects/schmitzm/
10   * A Cancel {@link JButton} without text, but with an expressive {@link Icon}   *
11   * stat symbolizes CANCEL   * This program is free software; you can redistribute it and/or
12   *   * modify it under the terms of the GNU Lesser General Public License
13   * @author Stefan Alfons Krüger   * as published by the Free Software Foundation; either version 3
14   *   * of the License, or (at your option) any later version.
15   */   *
16  public class CancelButton extends JButton {   * This program is distributed in the hope that it will be useful,
17          public static final Icon ICON_CANCEL_SMALL              = new ImageIcon( CancelButton.class.getResource("small/cancel.png") );   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19          private static final Dimension DIMENSION = new Dimension(35,25);   * GNU General Public License for more details.
20             *
21          /**   * You should have received a copy of the GNU Lesser General Public License (license.txt)
22           * Creates a {@link JButton} with an icon that symbolizes OK   * along with this program; if not, write to the Free Software
23           */   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
24          public CancelButton() {   * or try this link: http://www.gnu.org/licenses/lgpl.html
25                  super(ICON_CANCEL_SMALL);   *
26                  setMaximumSize(DIMENSION);   * Contributors:
27          }   *     Martin O. J. Schmitz - initial API and implementation
28     *     Stefan A. Krüger - additional utility classes
29          /**   ******************************************************************************/
30           * Creates a {@link JButton} with an icon that symbolizes OK  package skrueger.swing;
31           */  
32          public CancelButton(Action a) {  import java.awt.Dimension;
33                  super(a);  
34                  setIcon(ICON_CANCEL_SMALL);  import javax.swing.Action;
35                  setMaximumSize(DIMENSION);  import javax.swing.Icon;
36          }  import javax.swing.ImageIcon;
37    import javax.swing.JButton;
38    /**
39  }   * A Cancel {@link JButton} without text, but with an expressive {@link Icon}
40     * stat symbolizes CANCEL
41     *
42     * @author Stefan Alfons Krüger
43     *
44     */
45    public class CancelButton extends JButton {
46            public static final Icon ICON_CANCEL_SMALL              = new ImageIcon( CancelButton.class.getResource("small/cancel.png") );
47    
48            private static final Dimension DIMENSION = new Dimension(35,25);
49            
50            /**
51             * Creates a {@link JButton} with an icon that symbolizes OK
52             */
53            public CancelButton() {
54                    super(ICON_CANCEL_SMALL);
55                    setMaximumSize(DIMENSION);
56            }
57    
58            /**
59             * Creates a {@link JButton} with an icon that symbolizes OK
60             */
61            public CancelButton(Action a) {
62                    super(a);
63                    setIcon(ICON_CANCEL_SMALL);
64                    setMaximumSize(DIMENSION);
65            }
66    
67    
68    }

Legend:
Removed from v.243  
changed lines
  Added in v.244

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26