Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Please suggest me making a view

I was asking you think about your current LabelField and the lines it paints for a reason. 

 

In your current labelField you make it large enough for only 1 ine and you only paint 1 line.  There is nothing stopping you sizing it for multiple lines, and painting muliple lines. 

Developer
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Please suggest me making a view

I tried making service field .but did not succeeded .it take lot of managers.

package mypackage;
 
import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.DrawStyle;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.XYRect;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.component.RichTextField;
import net.rim.device.api.ui.container.HorizontalFieldManager;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;
import net.rim.device.api.ui.decor.Background;
import net.rim.device.api.ui.decor.BackgroundFactory;
 
public class SecondClass extends MainScreen{
 
public SecondClass() {
 
Background bg = BackgroundFactory.createLinearGradientBackground(Color.GREEN,
Color.GREEN,Color.GREEN,Color.GREEN);
Background grayBackground = BackgroundFactory.createLinearGradientBackground(Color.GRAY,
Color.GRAY,Color.GRAY,Color.GRAY);
Font headerFont = Font.getDefault().derive(Font.PLAIN,12);
 
 
MyHeaderLabel header=new MyHeaderLabel();
header.setText("Landing Page");
header.setBackground(bg);
setBanner(header);
 
VerticalFieldManager headerManager=new VerticalFieldManager();
MyHeaderLabel secondHeader=new MyHeaderLabel();
secondHeader.setText("Customer Information");
secondHeader.setFont(headerFont);
 
secondHeader.setBackground(bg);
 
 
VerticalFieldManager customerFieldManager=new VerticalFieldManager();
 
 
 
 
HorizontalFieldManager phoneNumberFieldManager=new HorizontalFieldManager(){
 
protected void paint(Graphics graphics) {
// TODO Auto-generated method stub
graphics.setColor(Color.WHEAT);
graphics.fillRect(0, 0, Display.getWidth(), 150);
super.paint(graphics);
}
};
LabelField  phoneNumberText=new LabelField("Phone Number:",LabelField.HCENTER){
 
protected void layout(int width, int height) {
// TODO Auto-generated method stub
super.layout(width, height);
setExtent(width/2, this.getHeight());
}
protected void paint(Graphics graphics) {
graphics.setColor(Color.RED);
super.paint(graphics);
}
};
 
phoneNumberText.setFont(headerFont);
 
LabelField  PhoneNumbervalue=new LabelField("555556882349342"){
protected void layout(int width, int height) {
// TODO Auto-generated method stub
super.layout(width, height);
setExtent(width/2, this.getHeight());
}
protected void paint(Graphics graphics) {
graphics.setColor(Color.BLACK);
super.paint(graphics);
}
 
 
};
phoneNumberFieldManager.add(phoneNumberText);
PhoneNumbervalue.setFont(headerFont);
 
phoneNumberFieldManager.add(PhoneNumbervalue);
customerFieldManager.add(phoneNumberFieldManager);
 
 
 
 
            HorizontalFieldManager addressManager=new HorizontalFieldManager(){
 
protected void paint(Graphics graphics) {
// TODO Auto-generated method stub
graphics.setColor(Color.WHEAT);
graphics.fillRect(0, 0, Display.getWidth(), 150);
super.paint(graphics);
}
};
LabelField  addressText=new LabelField("Adress:",LabelField.HCENTER){
 
protected void layout(int width, int height) {
// TODO Auto-generated method stub
super.layout(width, height);
setExtent(width/2, this.getHeight());
}
protected void paint(Graphics graphics) {
graphics.setColor(Color.RED);
super.paint(graphics);
}
};
 
addressText.setFont(headerFont);
 
LabelField  addressvalue=new LabelField("193373  mVGUjwee"){
protected void layout(int width, int height) {
// TODO Auto-generated method stub
super.layout(width, height);
setExtent(width/2, this.getHeight());
}
protected void paint(Graphics graphics) {
graphics.setColor(Color.BLACK);
super.paint(graphics);
}
 
 
};
addressManager.add(addressText);
addressvalue.setFont(headerFont);
 
addressManager.add(addressvalue);
customerFieldManager.add(addressManager);
//****************Do next field************
 
 
MyHeaderLabel servicePlanHeader=new MyHeaderLabel();
servicePlanHeader.setText("Service Plan");
servicePlanHeader.setFont(headerFont);
servicePlanHeader.setBackground(bg);
 
 
 
RichTextField servicePlanValue=new RichTextField(Field.NON_FOCUSABLE);
String x=new String("Optik 2HID/1SD"+"\n"+"1 PVR,2 STB");
 
servicePlanValue.setText(x);
servicePlanValue.setFont(headerFont);
servicePlanValue.setBackground(grayBackground);
 
MyHeaderLabel assigmentInfo=new MyHeaderLabel();
assigmentInfo.setText("Assignment Info");
assigmentInfo.setFont(headerFont);
assigmentInfo.setBackground(bg);
 
          
RichTextField assigmentInfoGray=new RichTextField(Field.NON_FOCUSABLE);
String str=new String("EDTNABDS01-P1-1-1"+"\n"+"pairs 1:1,24,45:8"+"\n"+"Modem model,version"+"\n"+"#STB 3 LinkSmiley FrustratedTB Info");
 
assigmentInfoGray.setText(str);
assigmentInfoGray.setFont(headerFont);
assigmentInfoGray.setBackground(grayBackground);
 
MyHeaderLabel serviceQuality=new MyHeaderLabel();
serviceQuality.setText("Service Quality");
serviceQuality.setFont(headerFont);
serviceQuality.setBackground(bg);
 
MyHeaderLabel provisionStatus=new MyHeaderLabel();
provisionStatus.setText("Provision Status");
provisionStatus.setFont(headerFont);
provisionStatus.setBackground(grayBackground);
 
 
 
servicePlanHeader.setMargin(2,0,0,0);
servicePlanValue.setPadding(0,0,0,10);
assigmentInfo.setMargin(2,0,0,0);
assigmentInfoGray.setPadding(0,4,0,10);
serviceQuality.setMargin(2,0,0,0);
provisionStatus.setMargin(2,0,0,0);
 
 
 
 
 
headerManager.setMargin(20,20,0,20);
customerFieldManager.setMargin(4,0,4,0);
headerManager.add(secondHeader);
headerManager.add(customerFieldManager);
headerManager.add(servicePlanHeader);
headerManager.add(servicePlanValue);
headerManager.add(assigmentInfo);
headerManager.add(assigmentInfoGray);
headerManager.add(serviceQuality);
headerManager.add(provisionStatus);
 
 
add(headerManager);
 
 
 
}
 
}
 
9700.png
i am not able to move label toward right as in original view .
is there any simple way to solve this problem..
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Please suggest me making a view

"I tried making service field .but did not succeeded .it take lot of managers."

 

I'm not sure exactly which area you are talking about.  I presume it is the area that begins with the text

Provisioning Status....

 

That should not need many Managers.  It should only need 1.  You need to make a Manager that positions the Fields where you want them to do.  I have already given you the links to a KB article and a video that explain how to do this.  Here are the links again, please review them.

 

http://supportforums.blackberry.com/t5/Java-Development/Create-a-custom-layout-manager-for-a-screen/...

http://supportforums.blackberry.com/t5/Java-Development/How-to-Extend-Manager/ta-p/446749

 

"i am not able to move label toward right as in original view ."

Which Label are you talking about?

Highlighted
Developer
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Please suggest me making a view

Hello sir i am talking about 

 

phone number field..

and address field i think it is not correct .

landing-page.jpg

Developer
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Please suggest me making a view

I understand little bit layout manager class . but did not able to make same as in real view .

 

i want to set the position of label field and image in provision status.

package mypackage;

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.DrawStyle;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.XYRect;
import net.rim.device.api.ui.component.BitmapField;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.component.RichTextField;
import net.rim.device.api.ui.container.HorizontalFieldManager;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;
import net.rim.device.api.ui.decor.Background;
import net.rim.device.api.ui.decor.BackgroundFactory;

public class SecondClass extends MainScreen{
	
	public SecondClass() {
		
		 Background bg = BackgroundFactory.createLinearGradientBackground(Color.GREEN,
				 Color.GREEN,Color.GREEN,Color.GREEN);
		 Background grayBackground = BackgroundFactory.createLinearGradientBackground(Color.GRAY,
				 Color.GRAY,Color.GRAY,Color.GRAY);
		 Font headerFont = Font.getDefault().derive(Font.PLAIN,12);


		 MyHeaderLabel header=new MyHeaderLabel();
			header.setText("Landing Page");
			header.setBackground(bg);
			setBanner(header);
			
			VerticalFieldManager headerManager=new VerticalFieldManager();
			 MyHeaderLabel secondHeader=new MyHeaderLabel();
			 secondHeader.setText("Customer Information");
			 secondHeader.setFont(headerFont);

			 secondHeader.setBackground(bg);
			 
			 
			 VerticalFieldManager customerFieldManager=new VerticalFieldManager();
				 
	
				 
				
			 HorizontalFieldManager phoneNumberFieldManager=new HorizontalFieldManager(){
				 
				 protected void paint(Graphics graphics) {
						// TODO Auto-generated method stub
						 graphics.setColor(Color.WHEAT);
						 graphics.fillRect(0, 0, Display.getWidth(), 150);
						super.paint(graphics);
					}
			 };
			 LabelField  phoneNumberText=new LabelField("Phone Number:",LabelField.HCENTER){
				 
				 protected void layout(int width, int height) {
					// TODO Auto-generated method stub
					super.layout(width, height);
					setExtent(width/2, this.getHeight());
				}
				 protected void paint(Graphics graphics) {
					 graphics.setColor(Color.RED);
					super.paint(graphics);
				}
			 };
			 
			 phoneNumberText.setFont(headerFont);

			 LabelField  PhoneNumbervalue=new LabelField("555556882349342"){
				 protected void layout(int width, int height) {
						// TODO Auto-generated method stub
						super.layout(width, height);
						setExtent(width/2, this.getHeight());
					}
					 protected void paint(Graphics graphics) {
						 graphics.setColor(Color.BLACK);
						super.paint(graphics);
					}
				 
				 
			 };
			 phoneNumberFieldManager.add(phoneNumberText);
			 PhoneNumbervalue.setFont(headerFont);

			 phoneNumberFieldManager.add(PhoneNumbervalue);
			 customerFieldManager.add(phoneNumberFieldManager);

			 
			 
			 
            HorizontalFieldManager addressManager=new HorizontalFieldManager(){
				 
				 protected void paint(Graphics graphics) {
						// TODO Auto-generated method stub
						 graphics.setColor(Color.WHEAT);
						 graphics.fillRect(0, 0, Display.getWidth(), 150);
						super.paint(graphics);
					}
			 };
			 LabelField  addressText=new LabelField("Adress:",LabelField.HCENTER){
				 
				 protected void layout(int width, int height) {
					// TODO Auto-generated method stub
					super.layout(width, height);
					setExtent(width/2, this.getHeight());
				}
				 protected void paint(Graphics graphics) {
					 graphics.setColor(Color.RED);
					super.paint(graphics);
				}
			 };
			 
			 addressText.setFont(headerFont);

			 LabelField  addressvalue=new LabelField("193373  mVGUjwee"){
				 protected void layout(int width, int height) {
						// TODO Auto-generated method stub
						super.layout(width, height);
						setExtent(width/2, this.getHeight());
					}
					 protected void paint(Graphics graphics) {
						 graphics.setColor(Color.BLACK);
						super.paint(graphics);
					}
				 
				 
			 };
			 addressManager.add(addressText);
			 addressvalue.setFont(headerFont);

			 addressManager.add(addressvalue);
			 customerFieldManager.add(addressManager);
//****************Do next field************
			 
			 
			 MyHeaderLabel servicePlanHeader=new MyHeaderLabel();
			 servicePlanHeader.setText("Service Plan");
			 servicePlanHeader.setFont(headerFont);
			 servicePlanHeader.setBackground(bg);
			 
			 
			 
			 RichTextField servicePlanValue=new RichTextField(Field.NON_FOCUSABLE);
			 String x=new String("Optik 2HID/1SD"+"\n"+"1 PVR,2 STB");

			 servicePlanValue.setText(x);
			 servicePlanValue.setFont(headerFont);
			 servicePlanValue.setBackground(grayBackground);
			 
			 MyHeaderLabel assigmentInfo=new MyHeaderLabel();
			 assigmentInfo.setText("Assignment Info");
			 assigmentInfo.setFont(headerFont);
			 assigmentInfo.setBackground(bg);
			 
	           
			 RichTextField assigmentInfoGray=new RichTextField(Field.NON_FOCUSABLE);
			 String str=new String("EDTNABDS01-P1-1-1"+"\n"+"pairs 1:1,24,45:8"+"\n"+"Modem model,version"+"\n"+"#STB 3 Link:STB Info");

			 assigmentInfoGray.setText(str);
			 assigmentInfoGray.setFont(headerFont);
			 assigmentInfoGray.setBackground(grayBackground);
			 
			 MyHeaderLabel serviceQuality=new MyHeaderLabel();
			 serviceQuality.setText("Service Quality");
			 serviceQuality.setFont(headerFont);
			 serviceQuality.setBackground(bg);
			 
			 RichTextField provisionStatus=new RichTextField();
			 provisionStatus.setText("Provision Status");
			 provisionStatus.setFont(headerFont);
			 provisionStatus.setBackground(grayBackground);
			 
			 
			 LayoutManager provionalStatusManager=new LayoutManager();
			 provionalStatusManager.add(provisionStatus);
			 
			 
				Bitmap bmp =Bitmap.getBitmapResource("check_800X480.png");
				BitmapField bf=new BitmapField(bmp);
				provionalStatusManager.add(bf);

			 
			 servicePlanHeader.setMargin(2,0,0,0);
			 servicePlanValue.setPadding(0,0,0,10);
			 assigmentInfo.setMargin(2,0,0,0);
			 assigmentInfoGray.setPadding(0,4,0,10);
			 serviceQuality.setMargin(2,0,0,0);
			 provisionStatus.setMargin(2,0,0,0);





			headerManager.setMargin(20,20,0,20);
			customerFieldManager.setMargin(4,0,4,0);
			headerManager.add(secondHeader);
			headerManager.add(customerFieldManager);
			headerManager.add(servicePlanHeader);
			headerManager.add(servicePlanValue);
			headerManager.add(assigmentInfo);
			headerManager.add(assigmentInfoGray);
			headerManager.add(serviceQuality);
			headerManager.add(provionalStatusManager);


			add(headerManager);


		
	}
	
}

 

package mypackage;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Manager;

/*********************
Layout Manager
*********************/
class LayoutManager extends Manager {
   public LayoutManager() {
       //construct a manager with vertical scrolling
       super(Manager.VERTICAL_SCROLL);
   }
   //overwrite the nextFocus method for custom navigation
   protected int nextFocus(int direction, boolean alt) {
       //retrieve the index of the current field that is selected
       int index= this.getFieldWithFocusIndex();
      
      // if we did not handle it, let the manager's parent class
      if (index == this.getFieldWithFocusIndex())
          return super.nextFocus(direction, alt);
      else
          return index;
   }
   protected void sublayout(int width, int height) {
       Field field;
       //get total number of fields within this manager
       int numberOfFields = getFieldCount();
       int x = 0;
       int y = 0;
       for (int i = 0;i < numberOfFields;i++) {
           field = getField(i); //get the field
           setPositionChild(field,x,y); //set the position for the field
           layoutChild(field, width, height); //lay out the field
         
       }
       setExtent(width, height);
   }
   public int getPreferredWidth() {
       return 160;
   }
   public int getPreferredHeight() {
	   
	   int height= 0;
       int numberOfFields= getFieldCount();
       for (int i= 0; i < numberOfFields; i++) {
           height+= getField(i).getPreferredHeight();
       }
       return height;

}
   
   
}

 

9700.png

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Please suggest me making a view

You have two approaches for that Field

 

1) Use a Manager

 

You would have one Manager for the entire panel, and use it to layout the individual Fields within that.

 

So you would have a LabelField for the Phone Number Label, and a RichTextField for the phone number, the a LabelField for the Address Label and a RichTextField for the Address, and so on. Add all of these to the Customer information Manager you have to layout all these Fields,  Then have it position the Fields where you want them to do. 

 

To so this, read the links I provided.

 

2) Have one big LabelField

 

You could do that entire 'Panel' with one LabelField, by overriding layout to make it large enough, and then overriding paint to paint the Text in the specific places you want to put them.  You have already done pretty much the same sort of the think with MyLabel in your other Thread.  Just extend the concepts that you learned there. 

 

The LabelField option is simpler, but less functional.  I would start using it and then perhaps change the it later.

 

Remember that you will to supply the LabelField with the Strings you want displayed. 

Developer
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Please suggest me making a view

Hello

 

Sir i done littel bit with prvision satus .But problem is that what is do with next field "Line stability".

 

should i take another object of manager and add these three field .?

same case with next field?

 

till now i done like tha

package mypackage;
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.Manager;

/*********************
Layout Manager
*********************/
class LayoutManager extends Manager {
   public LayoutManager() {
       //construct a manager with vertical scrolling
       super(Manager.NO_VERTICAL_SCROLL);
   }
   //overwrite the nextFocus method for custom navigation
   protected int nextFocus(int direction, boolean alt) {
       //retrieve the index of the current field that is selected
       int index= this.getFieldWithFocusIndex();
      
      // if we did not handle it, let the manager's parent class
      if (index == this.getFieldWithFocusIndex())
          return super.nextFocus(direction, alt);
      else
          return index;
   }
   protected void sublayout(int width, int height) {
	   Field field;
       //get total number of fields within this manager
       int numberOfFields = getFieldCount();
       int x = 0;
       int y = 0;
       for (int i = 0;i < numberOfFields;i++) {
           field = getField(i); //get the field
           setPositionChild(field,x,y); //set the position for the field
           layoutChild(field, width, height); //lay out the field
           x += 100;
       }
       setExtent(width, 50);
   }
   public int getPreferredWidth() {
       return 480;
   }
   public int getPreferredHeight() {
	   
	   int height= 0;
       int numberOfFields= getFieldCount();
       for (int i= 0; i < numberOfFields; i++) {
           height+= getField(i).getPreferredHeight();
       }
       return height;

}
   protected void paint(Graphics graphics) {
		// TODO Auto-generated method stub
	   graphics.setColor(Color.GRAY);
	   graphics.fillRect(0, 0, 440, 50);
	   graphics.setColor(Color.BLACK);
		super.paint(graphics);
	}
   
}

 

package mypackage;

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.DrawStyle;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.Manager;
import net.rim.device.api.ui.XYRect;
import net.rim.device.api.ui.component.BitmapField;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.component.RichTextField;
import net.rim.device.api.ui.container.HorizontalFieldManager;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;
import net.rim.device.api.ui.decor.Background;
import net.rim.device.api.ui.decor.BackgroundFactory;

public class SecondClass extends MainScreen{
	
	public SecondClass() {
		
		 Background bg = BackgroundFactory.createLinearGradientBackground(Color.GREEN,
				 Color.GREEN,Color.GREEN,Color.GREEN);
		 Background grayBackground = BackgroundFactory.createLinearGradientBackground(Color.GRAY,
				 Color.GRAY,Color.GRAY,Color.GRAY);
		 Font headerFont = Font.getDefault().derive(Font.PLAIN,12);


		 MyHeaderLabel header=new MyHeaderLabel();
			header.setText("Landing Page");
			header.setBackground(bg);
			setBanner(header);
			
			VerticalFieldManager headerManager=new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL);
			 MyHeaderLabel secondHeader=new MyHeaderLabel();
			 secondHeader.setText("Customer Information");
			 secondHeader.setFont(headerFont);

			 secondHeader.setBackground(bg);
			 
			 
			 VerticalFieldManager customerFieldManager=new VerticalFieldManager();
				 
	
				 
				
			 HorizontalFieldManager phoneNumberFieldManager=new HorizontalFieldManager(){
				 
				 protected void paint(Graphics graphics) {
						// TODO Auto-generated method stub
						 graphics.setColor(Color.WHEAT);
						 graphics.fillRect(0, 0, Display.getWidth(), 150);
						super.paint(graphics);
					}
			 };
			 LabelField  phoneNumberText=new LabelField("Phone Number:",LabelField.HCENTER){
				 
				 protected void layout(int width, int height) {
					// TODO Auto-generated method stub
					super.layout(width, height);
					setExtent(width/2, this.getHeight());
				}
				 protected void paint(Graphics graphics) {
					 graphics.setColor(Color.RED);
					super.paint(graphics);
				}
			 };
			 
			 phoneNumberText.setFont(headerFont);

			 LabelField  PhoneNumbervalue=new LabelField("555556882349342"){
				 protected void layout(int width, int height) {
						// TODO Auto-generated method stub
						super.layout(width, height);
						setExtent(width/2, this.getHeight());
					}
					 protected void paint(Graphics graphics) {
						 graphics.setColor(Color.BLACK);
						super.paint(graphics);
					}
				 
				 
			 };
			 phoneNumberFieldManager.add(phoneNumberText);
			 PhoneNumbervalue.setFont(headerFont);

			 phoneNumberFieldManager.add(PhoneNumbervalue);
			 customerFieldManager.add(phoneNumberFieldManager);

			 
			 
			 
            HorizontalFieldManager addressManager=new HorizontalFieldManager(){
				 
				 protected void paint(Graphics graphics) {
						// TODO Auto-generated method stub
						 graphics.setColor(Color.WHEAT);
						 graphics.fillRect(0, 0, Display.getWidth(), 150);
						super.paint(graphics);
					}
			 };
			 LabelField  addressText=new LabelField("Adress:",LabelField.HCENTER){
				 
				 protected void layout(int width, int height) {
					// TODO Auto-generated method stub
					super.layout(width, height);
					setExtent(width/2, this.getHeight());
				}
				 protected void paint(Graphics graphics) {
					 graphics.setColor(Color.RED);
					super.paint(graphics);
				}
			 };
			 
			 addressText.setFont(headerFont);

			 LabelField  addressvalue=new LabelField("193373  mVGUjwee"){
				 protected void layout(int width, int height) {
						// TODO Auto-generated method stub
						super.layout(width, height);
						setExtent(width/2, this.getHeight());
					}
					 protected void paint(Graphics graphics) {
						 graphics.setColor(Color.BLACK);
						super.paint(graphics);
					}
				 
				 
			 };
			 addressManager.add(addressText);
			 addressvalue.setFont(headerFont);

			 addressManager.add(addressvalue);
			 customerFieldManager.add(addressManager);
//****************Do next field************
			 
			 
			 MyHeaderLabel servicePlanHeader=new MyHeaderLabel();
			 servicePlanHeader.setText("Service Plan");
			 servicePlanHeader.setFont(headerFont);
			 servicePlanHeader.setBackground(bg);
			 
			 
			 
			 RichTextField servicePlanValue=new RichTextField(Field.NON_FOCUSABLE);
			 String x=new String("Optik 2HID/1SD"+"\n"+"1 PVR,2 STB");

			 servicePlanValue.setText(x);
			 servicePlanValue.setFont(headerFont);
			 servicePlanValue.setBackground(grayBackground);
			 
			 MyHeaderLabel assigmentInfo=new MyHeaderLabel();
			 assigmentInfo.setText("Assignment Info");
			 assigmentInfo.setFont(headerFont);
			 assigmentInfo.setBackground(bg);
			 
	           
			 RichTextField assigmentInfoGray=new RichTextField(Field.NON_FOCUSABLE);
			 String str=new String("EDTNABDS01-P1-1-1"+"\n"+"pairs 1:1,24,45:8"+"\n"+"Modem model,version"+"\n"+"#STB 3 Link:STB Info");

			 assigmentInfoGray.setText(str);
			 assigmentInfoGray.setFont(headerFont);
			 assigmentInfoGray.setBackground(grayBackground);
			 
			 MyHeaderLabel serviceQuality=new MyHeaderLabel();
			 serviceQuality.setText("Service Quality");
			 serviceQuality.setFont(headerFont);
			 serviceQuality.setBackground(bg);
			 
			 RichTextField provisionStatus=new RichTextField(Field.NON_FOCUSABLE);
			 provisionStatus.setText("Provision Status");
			 provisionStatus.setFont(headerFont);
			 //provisionStatus.setBackground(grayBackground);
			 
			 HrefField test=new HrefField("Assignment");
			// test.setText("Provision Status");
			 test.setColours(Color.GRAY,Color.GREEN,Color.WHITE);
			// test.setBackground(grayBackground);
			 
			 
			 LayoutManager provionalStatusManager=new LayoutManager();
			 provionalStatusManager.add(provisionStatus);
			 
			 
				Bitmap bmp =Bitmap.getBitmapResource("check_800X480.png");
				BitmapField bf=new BitmapField(bmp);
				provionalStatusManager.add(bf);
				 provionalStatusManager.add(test);


			 
			 servicePlanHeader.setMargin(2,0,0,0);
			 servicePlanValue.setPadding(0,0,0,10);
			 assigmentInfo.setMargin(2,0,0,0);
			 assigmentInfoGray.setPadding(0,4,0,10);
			 serviceQuality.setMargin(2,0,0,0);
			 provisionStatus.setMargin(2,0,0,0);





			headerManager.setMargin(20,20,0,20);
			customerFieldManager.setMargin(4,0,4,0);
			headerManager.add(secondHeader);
			headerManager.add(customerFieldManager);
			headerManager.add(servicePlanHeader);
			headerManager.add(servicePlanValue);
			headerManager.add(assigmentInfo);
			headerManager.add(assigmentInfoGray);
			headerManager.add(serviceQuality);
			headerManager.add(provionalStatusManager);


			add(headerManager);


		
	}
	
}

 

t9700.png

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Please suggest me making a view

You choose.  Either

1) increase the 'y' position in your LayoutManager to cope with the next Field, or

2) use a new LayoutManager instance and add your next set of Fields to that. 

 

Personally I would do it in one Manager, so I would choose option (1), as I have said a number of times.  But you can do it differently if you wish. 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Please suggest me making a view

I have found that the Java micro site has some really good stuff on UI and how to use it.  If you haven't visited already, have a look around here:

 

https://developer.blackberry.com/java/documentation/uiquickref_intro_1986602_11.html