BlackBerry Forums Support Community               

Closed Thread
LinkBack Thread Tools
Old 09-18-2009, 06:53 AM   #1 (permalink)
Thumbs Must Hurt
Join Date: Mar 2007
Location: India
Model: 8100
Carrier: Airtel
Posts: 64
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default custom basic edit field

Please Login to Remove!

Hello All,

I am trying to customize basic edit field for editing text which is more than screen height

First I split the text in number of lines. Then in paint I drawn them. And i have set the cursor position to 0 (zero).

Below is the paitn method.

protected void paint(Graphics graphics){
graphics.drawBitmap(0, 0, Graphics.getScreenWidth(), Graphics.getScreenHeight(), backgroundImage, 0 , 0);
int y = 5;
for(int i = startIndex; i < scrollIndex; i++){
graphics.drawText(vecData.elementAt(i).toString(), 2, y);
y = y + textFieldFont.getHeight() + 6;
}catch(Exception ex){
System.out.println("Exception in paint :: CustomTextField "+ex.toString());

statrindex and scrollindex are incremented in navigation method.

But, when I enter new charatcer it gets drawn on present text. And cursor is not visible.

I want the this to be worked same as textfield but its not working. can any one tell me how can I do this?

Crazy for BlackBerry
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Copyright 2004-2014
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.