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
Regular Contributor
ramroum1986
Posts: 94
Registered: ‎02-27-2010
My Device: rien
My Carrier: etudiant

labelfield and editfield in HorizontalFieldManager

hello I want to build a labelfield and  editfield in the same line with a background
as follows:

 

1734i2186DFFC078CE5D5

 

I used HorizontalFieldManager but my problem is not well aligned editfield

1733i58DF3C2799E30402

Please use plain text.
Regular Contributor
ramroum1986
Posts: 94
Registered: ‎02-27-2010
My Device: rien
My Carrier: etudiant

Re: labelfield and editfield in HorizontalFieldManager

 

	
 HorizontalFieldManager h1 = new HorizontalFieldManager(){
	 protected void paintBackground(Graphics g) {
 		
		 
   	     g.setColor(Color.WHITE);
   	     
g.drawBitmap(0, 0, getWidth(), getHeight(), Bitmap.getBitmapResource("editincon.png"), 0, 0);
g.drawText("Title: ",10 , 20);

   	 	  
   		 }
	 public void sublayout( int maxWidth, int maxHeight )
     {
     super.sublayout( Bitmap.getBitmapResource("editincon.png").getWidth() , Bitmap.getBitmapResource("editincon.png").getHeight()+10);
      setExtent(  Bitmap.getBitmapResource("editincon.png").getWidth() , Bitmap.getBitmapResource("editincon.png").getHeight()+10);
   }
 };

 h1.add(_title); // add editfield

 

 

Please use plain text.