KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jftp > gui > tasks > RemoverQuery


1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15  */

16 package net.sf.jftp.gui.tasks;
17
18 import net.sf.jftp.gui.framework.*;
19 import net.sf.jftp.util.*;
20
21 import java.awt.*;
22 import java.awt.event.*;
23
24
25 public class RemoverQuery extends HFrame implements ActionListener
26 {
27     private String JavaDoc file;
28     private String JavaDoc type;
29     private HButton ok = new HButton("Ok");
30     private HButton cancel = new HButton("Cancel");
31
32     public RemoverQuery(String JavaDoc file, String JavaDoc type)
33     {
34         this.file = file;
35         this.type = type;
36
37         setSize(200, 70);
38         setTitle("Really?");
39         setLayout(new FlowLayout());
40         setLocation(150, 150);
41
42         add(ok);
43         add(cancel);
44
45         ok.addActionListener(this);
46         cancel.addActionListener(this);
47
48         setVisible(true);
49     }
50
51     public void actionPerformed(ActionEvent e)
52     {
53         if(e.getSource() == ok)
54         {
55             AutoRemover armv = new AutoRemover(file, type);
56             this.dispose();
57         }
58         else
59         {
60             this.dispose();
61         }
62     }
63 }
64
Popular Tags