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

Ferraz Shawmut A070UD33KI630 Y300240 Semiconductor Fuse
$4.0
Ferraz Shawmut A070UD33KI630 Y300240 Semiconductor Fuse pictureNATIONAL SEMICONDUCTOR LP2952IMNOPB FNFP LP2952IMNOPB
$2.58
NATIONAL SEMICONDUCTOR LP2952IMNOPB FNFP LP2952IMNOPB pictureON Semiconductor CAT809TSDI-T3 IC,MPU 135pcs
$59.0
ON Semiconductor CAT809TSDI-T3 IC,MPU 135pcs pictureON Semiconductor MJE344G RF Transistor 96pcs
$59.0
ON Semiconductor MJE344G RF Transistor 96pcs pictureFusion Semiconductor Systems MP150PC MicroLite Photostabilizer System
$1200.0
Fusion Semiconductor Systems MP150PC MicroLite Photostabilizer System picture






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