1 16 package net.sf.jftp.gui.framework; 17 18 import java.awt.*; 19 20 import javax.swing.*; 21 22 23 public class HComboBox extends JPanel { 25 private JLabel label; 26 public JComboBox comboBox; 27 28 public HComboBox(String l) 29 { 30 setLayout(new BorderLayout(5, 5)); 31 32 label = new JLabel(l + " "); 33 add("West", label); 34 35 comboBox = new JComboBox(); 37 add("East", comboBox); 38 39 setVisible(true); 40 } 41 42 public HComboBox(String l, String [] t) 43 { 44 setLayout(new BorderLayout(5, 5)); 45 46 label = new JLabel(l + " "); 47 add("West", label); 48 49 comboBox = new JComboBox(t); 51 add("East", comboBox); 52 53 setVisible(true); 54 } 55 56 70 public String getLabel() 71 { 72 return label.getText(); 73 } 74 75 public void setLabel(String l) 76 { 77 label.setText(l + " "); 78 } 79 80 public Object getSelectedItem() 81 { 82 return comboBox.getSelectedItem(); 83 } 84 85 public void addItem(Object obj) 86 { 87 comboBox.addItem(obj); 88 } 89 90 public void addActionListener(java.awt.event.ActionListener actListen) 91 { 92 comboBox.addActionListener(actListen); 93 } 94 95 112 public void setEditable(boolean yesno) 113 { 114 comboBox.setEditable(yesno); 115 } 116 } 117 | Popular Tags |