1 16 package net.sf.jftp.gui.framework; 17 18 import java.awt.*; 19 20 import javax.swing.*; 21 22 23 public class HPasswordField extends JPanel 24 { 25 private JLabel label; 26 public JPasswordField text; 27 28 public HPasswordField(String l, String t) 29 { 30 setLayout(new BorderLayout(5, 5)); 31 32 label = new JLabel(l + " "); 33 add("West", label); 34 35 text = new JPasswordField(t, 12); 36 add("East", text); 37 38 setVisible(true); 39 } 40 41 public String getLabel() 42 { 43 return label.getText(); 44 } 45 46 public void setLabel(String l) 47 { 48 label.setText(l + " "); 49 } 50 51 public String getText() 52 { 53 return new String (text.getPassword()); 54 } 55 56 public void setText(String t) 57 { 58 text.setText(t); 59 } 60 } 61 | Popular Tags |