CustomComboBoxTest.java :  » Scripting » echo3ext20 » org » sgodden » echo » ext20 » testapp » Java Open Source

Java Open Source » Scripting » echo3ext20 
echo3ext20 » org » sgodden » echo » ext20 » testapp » CustomComboBoxTest.java
package org.sgodden.echo.ext20.testapp;

import nextapp.echo.app.event.ActionEvent;
import nextapp.echo.app.event.ActionListener;

import org.sgodden.echo.ext20.Button;
import org.sgodden.echo.ext20.Container;
import org.sgodden.echo.ext20.CustomComboBox;
import org.sgodden.echo.ext20.Label;
import org.sgodden.echo.ext20.Panel;
import org.sgodden.echo.ext20.TextField;

public class CustomComboBoxTest extends Panel {
  public CustomComboBoxTest() {
    super( "CustomComboBox Test");
    createUI();
  }

  private void createUI() {
    Container panel = new Panel();
    final CustomComboBox box = new CustomComboBox( panel);
    box.setValue( "ABC");
    add( box);

    panel.add( new Label( "Input your name:"));
    final TextField textField = new TextField( box.getValue());
    panel.add( textField);
    Button button = new Button( "OK");
    button.addActionListener( new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        box.setValue( textField.getValue());
      }
    });
    panel.add( button);
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.