FileDocCategorySizeDatePackage
ComboPanel.javaAPI DocExample768Tue Nov 27 14:24:50 GMT 2001None

ComboPanel

public class ComboPanel extends JPanel

Fields Summary
private JTextField
log
static final String[]
treasure
Constructors Summary
public ComboPanel(JTextField tf)


	  
	
		this.log = tf;

		// construct. Has to be final for inner class to access
		final JComboBox combo=new JComboBox(treasure);
		combo.setMaximumRowCount(5);
		
		// combo box sends item events
		combo.addItemListener(new ItemListener(){
			public void itemStateChanged(ItemEvent e)
				{
				   log.setText("Combo: " + combo.getSelectedItem());
				}
		});
		
		add(combo);
	
Methods Summary