Package javax.microedition.lcdui

Examples of javax.microedition.lcdui.Form


            FileConnection fc = (FileConnection) Connector.open("file://localhost/" + currDirName + fileName);
            if (!fc.exists())
                throw new IOException(T._("File does not exists."));

            Form props = new Form(T._("Properties") + ": " + fileName);
            props.addCommand(backToBCommand);
            props.setCommandListener(this);

            props.append(new StringItem(T._("Location"), currDirName));
            props.append(new StringItem(T._("Type"), fc.isDirectory() ? T._("Directory") : T._("Regular File")));
            props.append(new StringItem(T._("Size"), Long.toString((fc.isDirectory() ? fc.directorySize(true) : fc.fileSize()))));
            props.append(new StringItem(T._("Modified"), myDate(fc.lastModified())));

            ChoiceGroup attrs = new ChoiceGroup(T._("Attributes"), Choice.MULTIPLE, attrList, null);
            attrs.setSelectedFlags(new boolean[] { fc.canRead(), fc.canWrite(), fc.isHidden() });
            props.append(attrs);

            if (fileName.toLowerCase().endsWith(".sgf"))
                try {
                    StringBuffer sb = new StringBuffer();
                    InputStream is = fc.openInputStream();
                    InputStreamReader isr = new InputStreamReader(is);
                    SGFParser parser = new SGFParser(isr);
                    SGFNode head = parser.parseHead();
                    is.close();
                    for (Enumeration e = head.getProperties(); e.hasMoreElements(); ) {
                        sb.append(e.nextElement().toString());
                        sb.append("\n");
                    }
                    props.append(new StringItem(T._("SGF Header"), sb.toString()));
                } catch (Exception e) {
                }

            fc.close();
            display.setCurrent(props);
View Full Code Here


            //#endif
        }
    }

    void createFile() {
        Form creator = new Form(T._("New File"));
        nameInput = new TextField(T._("Enter Name"), null, 256, TextField.ANY);
        typeInput = new ChoiceGroup(T._("Enter File Type"), Choice.EXCLUSIVE,
                typeList, iconList);
        creator.append(nameInput);
        creator.append(typeInput);
        creator.addCommand(newOkCommand);
        creator.addCommand(backToBCommand);
        creator.setCommandListener(this);
        display.setCurrent(creator);
    }
View Full Code Here

   */
    public LoginView( Display d , Othello c ) {
        _display = d ;
        _controler = c ;

        _form = new Form("Saisir le login et le mot de passe :");
        _fieldLogin = new TextField("Login", "", 5, TextField.ANY) ;
        _fieldPass = new TextField("Pass","", 5,TextField.PASSWORD);
        _form.addCommand(CANCEL);
        _form.addCommand(VALID);
        _form.append( _fieldLogin ) ;
View Full Code Here

    // <editor-fold defaultstate="collapsed" desc=" UML Marker ">
    // #[regen=yes,id=DCE.0F96E763-C08A-FEF9-50FE-43BA1BC87382]
    // </editor-fold>
    public LoginView (Display disp, OthelloController ctrl){
        super(disp,ctrl);
        this.set_form(new Form("Saisir le login et le mot de passe :"));
        this.set_fieldLogin(new TextField("Login", "", 5, TextField.ANY) );
        this.set_fieldPass(new TextField("Pass","", 5,TextField.PASSWORD));

        this.get_form().addCommand(CANCEL);
        this.get_form().addCommand(VALID);
View Full Code Here

   */
  public LogView( Display d , Sudoku c ) {
        _display = d ;
        _controler = c ;

        _form = new Form("Saisir le pseudo");
        _field = new TextField("Pseudo", "", 5, TextField.ANY) ;
        _form.addCommand(CANCEL);
        _form.addCommand(VALID);
        _form.append( _field ) ;

View Full Code Here

  public static Form setupForm(String sTitle,
                 Object rImage,
                 String sText,
                 Item[] rItems)
  {
    Form aForm   = new Form(sTitle);
    int  nLayout = ImageItem.LAYOUT_CENTER | ImageItem.LAYOUT_NEWLINE_AFTER;

    if (rImage != null)
    {
      Image rImg;

      if (rImage instanceof Image)
      {
        rImg = (Image) rImage;
      }
      else if (rImage instanceof String)
      {
        rImg = ResourceBundle.getCurrent().getImage((String) rImage);
      }
      else
      {
        throw new IllegalArgumentException("Invalid image argument: " +
                           rImage);
      }

      if (rImg != null)
      {
        aForm.append(new ImageItem(null, rImg, nLayout, null));
      }
    }

    if (sText != null)
    {
      aForm.append(sText);
    }

    if (rItems != null)
    {
      for (int i = 0; i < rItems.length; i++)
      {
        aForm.append(rItems[i]);
      }
    }

    return aForm;
  }
View Full Code Here

    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
View Full Code Here

  /***************************************
   * @see NodeController#createLeafViewer(HierarchyNode)
   */
  public Displayable createLeafViewer(HierarchyNode rForNode)
  {
    Form aForm = new Form(rForNode.getTitle());

    aForm.append(new String(rForNode.getData()));

    return aForm;
  }
View Full Code Here

   *
   * @return A displayable instance that is used as the MIDlet's first screen
   */
  protected Displayable getStartScreen()
  {
    return new Form(TextUtil.getTypeName(getClass()));
  }
View Full Code Here

   *
   * @see BasicMidlet#getStartScreen()
   */
  protected Displayable getStartScreen()
  {
    return new Form("Test MIDlet");
  }
View Full Code Here

TOP

Related Classes of javax.microedition.lcdui.Form

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.