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: 69
Registered: ‎08-25-2008
My Device: Not Specified
Accepted Solution

Adding Rectangularbox to the EditField giving unneccessay verical bars?

[ Edited ]

Hi,

 

I am trying to add gray color rectangluar box to the EditField should contains blacktext with below code and it is giving some extra verical bars between letters while moving arrow buttons inside text it is showed in the attachment.

 

Please correct my code otherwise if you have any code regading this please send me.  Advanced thanks for your great help.

EditField edit = new EditField("", "Search News", 20, EditField.FILTER_DEFAULT) { private XYRect xyrect=new XYRect(); protected void paint(Graphics graphics) { xyrect=graphics.getClippingRect(); graphics.setColor(Color.GRAY); graphics.drawRect(xyrect.x,xyrect.y,xyrect.width,xyrect.height); graphics.setColor(Color.BLACK); super.paint(graphics);

}

 

Message Edited by sunil_garlapati on 11-05-2008 07:35 AM
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Adding Rectangularbox to the EditField giving unneccessay verical bars?

Instead of getClippingRectangle(), try just calling getHeight() and getWidth() on the Field to get your height and width.

 

Something like this:

graphics.setColor(Color.GRAY); graphics.drawRect(0,0,getWidth(),getHeight);

 

 

 

Developer
Posts: 25
Registered: ‎09-08-2008
My Device: Not Specified

Re: Adding Rectangularbox to the EditField giving unneccessay verical bars?

[ Edited ]

Thanks Alot RexDoug iam looking for the same.

 

Message Edited by gsk_56 on 11-06-2008 01:36 AM
Highlighted
Developer
Posts: 69
Registered: ‎08-25-2008
My Device: Not Specified

Re: Adding Rectangularbox to the EditField giving unneccessay verical bars?

Thank you very much RexDoug.