Package ui.misc

Source Code of ui.misc.CloseButton

package ui.misc;


import java.awt.Dimension;
import java.awt.event.ActionListener;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.plaf.basic.BasicButtonUI;


public class CloseButton extends JButton
{
  private static final long serialVersionUID = 8520586983517228851L;

  private static final Icon ICON = new ImageIcon("gfx/buttons/Close.png");

  public CloseButton(ActionListener listener)
  {
    super(ICON);

    setUI(new BasicButtonUI());
    setContentAreaFilled(false);
    setFocusable(false);
    setPreferredSize(new Dimension(ICON.getIconWidth(), ICON.getIconHeight()));

    addActionListener(listener);
  }

}
TOP

Related Classes of ui.misc.CloseButton

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.