BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 04-01-2007, 11:59 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
Thumbs down 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  
Old 04-03-2007, 09:35 PM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2007
Model: 8100
Carrier: Rogers
Posts: 77
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

#1 - Remove your call from super.paint(g) to outside of the if (focus) condition.
Offline  
Old 04-04-2007, 12:04 AM   #3 (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

Thanks BByMel ,
My first problem is solved.
Give me some suggestion for second problem.
thanks.
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

House of Doolittle EcoTones Monthly Desk Pad Calendar Blackberry
$23.41
House of Doolittle EcoTones Monthly Desk Pad Calendar Blackberry picture2pcs Mini 5pin Female Blackberry USB Jack Charger Port
$0.01
2pcs Mini 5pin Female Blackberry USB Jack Charger Port picture1Pack Orthodontic Dental Ortho Wax Blackberry scent For Braces gum irritation
$0.99
1Pack Orthodontic Dental Ortho Wax Blackberry scent For Braces gum irritation  pictureUnlock Code Pin BlackBerry Z30 GSM 4G
$1.99
Unlock Code Pin  BlackBerry  Z30 GSM 4G pictureUnlock Code Pin BlackBerry PRIV 4G
$1.99
Unlock Code Pin   BlackBerry  PRIV 4G picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.