1 16 package net.sf.jftp.gui.tasks; 17 18 import net.sf.jftp.*; 19 import net.sf.jftp.gui.framework.*; 20 import net.sf.jftp.net.*; 21 import net.sf.jftp.util.*; 22 23 import java.awt.*; 24 import java.awt.event.*; 25 26 import java.io.*; 27 28 34 public class Creator extends HFrame implements ActionListener 35 { 36 private HTextField text; 37 private HButton ok = new HButton("Create directory..."); 38 private BasicConnection con; 39 40 public Creator(String l, BasicConnection con) 41 { 42 this.con = con; 43 44 setTitle("Choose..."); 45 getContentPane().setLayout(new FlowLayout()); 46 47 text = new HTextField(l, ""); 48 getContentPane().add(text); 49 getContentPane().add(ok); 50 ok.addActionListener(this); 51 text.text.addActionListener(this); 52 53 pack(); 54 fixLocation(); 55 setVisible(true); 56 } 57 58 public void actionPerformed(ActionEvent e) 59 { 60 if((e.getSource() == ok) || (e.getSource() == text.text)) 61 { 62 setVisible(false); 63 con.mkdir(text.getText()); 64 } 65 } 66 } 67 | Popular Tags |