Package javax.microedition.lcdui

Examples of javax.microedition.lcdui.TextField


                 int       nConstraints,
                 final boolean bVerify,
                 Executable    rInvokeOnConfirm)
  {
    Item[]        aItems     = new Item[(bVerify ? 2 : 1)];
    final TextField aValueField;
    final TextField aVerifyField;

    if (sTitle == null)
    {
      sTitle = ResourceBundle.getCurrent().getString("JL_MtInput");
    }

    if (sLabel == null)
    {
      sLabel = ResourceBundle.getCurrent().getString("JL_LInput");
    }

    aValueField = new TextField(sLabel, sText, nMaxSize, nConstraints);
    aItems[0]   = aValueField;

    if (bVerify)
    {
      sLabel     = ResourceBundle.getCurrent().getString("JL_LVerify");
      aVerifyField = new TextField(sLabel, null, nMaxSize, nConstraints);
      aItems[1]    = aVerifyField;
    }
    else
    {
      aVerifyField = null;
    }

    Form aForm = setupForm(sTitle, "Img.Question", null, aItems);

    MessageScreen aBox = new MessageScreen(aForm, null, rInvokeOnConfirm)
    {
      // overloading the method finishDialog() in anonymous inner class
      // to handle the return value
      public Object finishDialog()
      {
        String sResult = aValueField.getString();

        if (bVerify)
        {
          String sVerify = aVerifyField.getString();

          if (sVerify.length() == 0 || !sVerify.equals(sResult))
          {
            sResult = null;
          }
View Full Code Here


    {
        super( title );
        if( listener == null )
            throw new IllegalArgumentException( "parameter 'listener' is null" );
        appendMessage( description );
        text_ = new TextField( null, null, INPUT_MAX_SIZE, TextField.ANY );
        append( text_ );
        addCommand( okCommand_ );
        addCommand( cancelCommand_ );
        setCommandListener( this );
        listener_ = listener;
View Full Code Here

    }

    final ChoiceGroup aChoice = new ChoiceGroup(getString("JL_LNodeType"),
                          Choice.EXCLUSIVE, aTypes,
                          aImages);
    final TextField   aInput  = new TextField(getString("JL_LNodeName"),
                          null, MAX_TITLE_SIZE,
                          TextField.ANY);

    // Use a MessageScreen to query the new title and, if confirmed, callback
    // to method newNode(); params null, null: no Image, empty textfield
    MessageScreen.showMessageBox(getString("JL_MtNewNode"), null, null,
                  new Item[] { aChoice, aInput }, false,
                  new Executable()
                  {
                    public void execute(Object rArg)
                      throws UserNotificationException
                    {
                      // this callback will only be invoked if the user selects Ok
                      newNode(aTypeKeys[aChoice
                                .getSelectedIndex()],
                          aInput.getString());
                    }
                  });
  }
View Full Code Here

            _list.setCommandListener(this);

            _addForm = new Form("Add CD");

            _artistCD = new TextField("Artist: ", null, 20, TextField.ANY);
            _titleCD = new TextField("Title: ", null, 20, TextField.ANY);

            _addForm.append(_artistCD);
            _addForm.append(_titleCD);

            _addForm.addCommand(_addSave);
View Full Code Here

      t.Read();
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    this.append(new TextField("Titulo", t.getTitile(), 30, TextField.ANY));
    this.append(new TextField("Album", t.getAlbum(), 30, TextField.ANY));
    this.append(new TextField("Compositor", t.getComposer(), 30, TextField.ANY));
    this.append(new TextField("Artista", t.getArtist(), 30, TextField.ANY));
    this.append(new TextField("A�o", t.getYear(), 4, TextField.ANY));
  }
View Full Code Here

    this.append(new TextField("A�o", t.getYear(), 4, TextField.ANY));
  }
 
  public void saveTag(){
    System.out.println("Comienza guadado");
    TextField text;
    text = (TextField)this.get(0);
    t.setTitile(text.getString());
    System.out.println("Title <= " + text.getString());
   
    text = (TextField)this.get(1);
    t.setAlbum(text.getString());
    System.out.println("Album <= " + text.getString());
   
    text = (TextField)this.get(2);
    t.setComposer(text.getString());
    System.out.println("Composer <= " + text.getString());
   
    text = (TextField)this.get(3);
    t.setArtist(text.getString());
    System.out.println("Artist <= " + text.getString());
   
    text = (TextField)this.get(4);
    t.setYear(text.getString());
    System.out.println("Year <= " + text.getString());
   
    try {
      t.Save(true);
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here

      this.deleteAll();
      this.append("No se encontraron archivos MP3");
      return;
    }
    controls_init = this.size();
    this.append(new TextField("Album", "", 30, TextField.ANY));
    this.append(new TextField("Compositor", "", 30, TextField.ANY));
    this.append(new TextField("Artista", "", 30, TextField.ANY));
    this.append(new TextField("A�o", "", 4, TextField.ANY));
  }
View Full Code Here

        t.Read();
      } catch (IOException e1) {
        e1.printStackTrace();
      }
      System.out.println("Comienza guardado");
      TextField text;
      text = (TextField) this.get(controls_init+0);
      System.out.println("Title:" + text.getString());
      if (text.getString().compareTo("") != 0) {
        t.setAlbum(text.getString());
        System.out.println("Album <= " + text.getString());
      }

      text = (TextField) this.get(controls_init+1);
      System.out.println("Title:" + text.getString());
      if (text.getString().compareTo("") != 0) {
        t.setComposer(text.getString());
        System.out.println("Composer <= " + text.getString());
      }

      text = (TextField) this.get(controls_init+2);
      if (text.getString().compareTo("") != 0) {
        t.setArtist(text.getString());
        System.out.println("Artist <= " + text.getString());
      }

      text = (TextField) this.get(controls_init+3);
      if (text.getString().compareTo("") != 0) {
        t.setYear(text.getString());
        System.out.println("Year <= " + text.getString());
      }
      try {
        t.Save(true);
      } catch (IOException e) {
        e.printStackTrace();
View Full Code Here

TOP

Related Classes of javax.microedition.lcdui.TextField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.