Here you can find the source of setToolIcons(AbstractButton b, Icon[] icons)
Icon
s of an AbstractButton
(JButton
or JToggleButton
).
Parameter | Description |
---|---|
b | the button whose icons are to be set |
icons | four <code>Icon</code> objects for different gadget states, such as created by the <code>createToolIcons</code> method. |
public static void setToolIcons(AbstractButton b, Icon[] icons)
//package com.java2s; /*//from w w w .j a v a 2 s. c o m * GraphicsUtil.java * Eisenkraut * * Copyright (c) 2004-2015 Hanns Holger Rutz. All rights reserved. * * This software is published under the GNU General Public License v3+ * * * For further information, please contact Hanns Holger Rutz at * contact@sciss.de */ import javax.swing.AbstractButton; import javax.swing.Icon; public class Main { /** * Change the <code>Icon</code>s of an * <code>AbstractButton</code> (<code>JButton</code> * or <code>JToggleButton</code>). * * @param b the button whose icons are to be set * @param icons four <code>Icon</code> objects for * different gadget states, such as * created by the <code>createToolIcons</code> method. * * @see #createToolIcons( int ) */ public static void setToolIcons(AbstractButton b, Icon[] icons) { b.setIcon(icons[0]); b.setSelectedIcon(icons[1]); b.setPressedIcon(icons[3]); b.setDisabledIcon(icons[2]); // Insets defInsets = b.getInsets(); } }