FileDocCategorySizeDatePackage
MVCLoop.javaAPI DocExample1096Sat Nov 25 12:54:16 GMT 2000None

MVCLoop

public class MVCLoop extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] a)

		Button b;
		final JComboBox ch;
		JFrame f = new JFrame("Testing");
		Container cp = f.getContentPane();
		cp.setLayout(new FlowLayout());

		b = new Button("Set");
		ch = new JComboBox();

		cp.add(b);
		b.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				ch.setSelectedIndex(4);
			}
		});

		ch.addItem("En/ett");
		ch.addItem("Zwei");
		ch.addItem("Tres");
		ch.addItem("Four");
		ch.addItem("Funf");
		ch.addItem("Seis");
		ch.addItem("Siete");
		ch.addItem("Octo");
		cp.add(ch);
		ch.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				System.out.println(e);
			}
		});

		f.pack();
		f.setVisible(true);