Package com.fiveht.tick.ui.toolbar

Source Code of com.fiveht.tick.ui.toolbar.ExitButton

/*
* Copyright (C) 2012 FiveHT Media Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
package com.fiveht.tick.ui.toolbar;

import com.fiveht.tick.ui.Icons;
import com.fiveht.tick.ui.ToolBar;
import com.fiveht.tick.ui.event.ExitEvent;
import com.fiveht.tick.ui.icon.Category;
import com.fiveht.tick.ui.icon.Size;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;

/**
*
* @author Nathan Crause
*/
public class ExitButton extends JButton implements ActionListener {
   
    public ExitButton() {
        super(Icons.get(Size._32x32, Category.ACTIONS, "process-stop.png"));
       
        init();
    }
   
    private void init() {
        setToolTipText("Exit the application");
        addActionListener(this);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        ((ToolBar)getParent()).getView().fireExit(new ExitEvent(this));
    }
   
}
TOP

Related Classes of com.fiveht.tick.ui.toolbar.ExitButton

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.