BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-01-2007, 11:53 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Jan 2007
Model: 7230
Posts: 16
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with Rectangle arround the EditField

Please Login to Remove!

Hi All,

I have two problem:

1. I have done rectangle arround the EditField when focus is come. But my problem is after entering the text in rectangle, text is removed whenever we try to go to another field. text is comming after come back. What to do for that plz suggest me.

2. My Second problem is, if entering the data in the rectagular area after complete on line cursor move to the another line and rectangular area automatic extended. But
I want after completion of one line cursor should not be move to another line only text should be move in one line from right to left in rectangular area. And also i want according to wish we could move the cursor from end of the line to the start of the line in a particular rectangle. Plz help me.


I have written some code for that


ed1=new EditField("","",200,BasicEditField.NO_NEWLINE)
{
boolean focus=false;
protected void onFocus(int i)
{
focus = true;
invalidate(); // redraw field
}
protected void onUnfocus() {
focus = false;
invalidate(); // redraw field
}
public void paint(Graphics g)
{
if(focus)
{
g.setColor(0x00000000);
System.out.println("");
g.drawRect(0,0, getExtent().width, getExtent().height);
super.paint(g);
}
}
};
ed2=new EditField("","",300,BasicEditField.NO_NEWLINE)
{
boolean focus=false;
protected void onFocus(int i)
{
focus = true;
invalidate(); // redraw field
}
protected void onUnfocus() {
focus = false;
invalidate(); // redraw field
}
public void paint(Graphics g)
{
if(focus)
{
g.setColor(0x00000000);
System.out.println("");
g.drawRect(0,0, getExtent().width, getExtent().height);
super.paint(g);
}
}
};
Offline  
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 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.