mobileDeveloper
mobileDeveloper

Reputation: 894

create popup screen in blackBerry

I want to create a popup screen in BlackBerry like the screen appear on long click (see the picture)enter image description here

My screen contain 3 items

image description


image description


image description

Can any one help me by an example or link to do this popup?

Upvotes: 0

Views: 2900

Answers (3)

Kiran_b
Kiran_b

Reputation: 199

Use the below code and call the GetPopup wherever you want to show the pop up screen

    final class Getpopup extends PopupScreen
    {
      EditField edf;
     AutoTextEditField edf1;
     HorizontalFieldManager hfm;
     public Getpopup()
    {
    super( new VerticalFieldManager());
    LabelField lf = new LabelField("Contact Info", LabelField.FIELD_HCENTER);
    SeparatorField sf = new SeparatorField(); 
    edf1= new AutoTextEditField("Name:","" ,20,EditField.NO_NEWLINE);        
    edf  = new EditField("Number:",ThirdScreen.get3);
    edf.setEditable(false);  
    VerticalFieldManager vfm =new VerticalFieldManager(VerticalFieldManager.FIELD_HCENTER);
    hfm=new HorizontalFieldManager(HorizontalFieldManager.FIELD_HCENTER);  
    ButtonField bf1 = new ButtonField("Save", ButtonField.FIELD_HCENTER);
    ButtonField bf2 = new ButtonField("Cancel", ButtonField.FIELD_HCENTER);
    hfm.add(bf1);
    hfm.add(bf2);
    vfm.add(lf);
    vfm.add(sf);
    vfm.add(edf1);
    vfm.add(edf); 
    vfm.add(hfm); 
    add(vfm);  
  }
  }

Upvotes: 1

Nilanchala
Nilanchala

Reputation: 5941

  1. Find the code here to create creating-borderless-transparent-popup screen in blackberry
  2. If your looking for custmizing the Buttons as appeared in image then visit custom-image-buttonfield-in-blackberry
  3. You have to make use of GridFieldManager.java for the layout you have used, Also you can customize your own layout.

Upvotes: 0

rfsk2010
rfsk2010

Reputation: 8611

Create a PopupDialog class which extends Dialog and then in the constructor, add the Buttons. If you would like your buttons to look like the above image, extend a field or button field and in paint method, draw the button and then the button text below the button. Add this custom button control in the PopupDialog.

Upvotes: 0

Related Questions