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

THREE WATERPOOF PUSHBUTTON OPERATOR CONTROL STATION 380V 6A METAL HOUSING
$11.0
THREE  WATERPOOF  PUSHBUTTON  OPERATOR CONTROL STATION 380V 6A METAL HOUSING picture802T-ALGP ALLEN BRADLEY SERIES J LIMIT SWITCH
$99.99
802T-ALGP ALLEN BRADLEY SERIES J LIMIT SWITCH pictureSti 70160-1018 Light Curtain Controller LCM-100 Be the first to write
$129.99
Sti 70160-1018 Light Curtain Controller LCM-100            Be the first to write pictureSola Multiple Switch 86-14002-02, 115VAC, 65W, 60Hz, Appears Unused *MUST SEE*
$44.95
Sola Multiple Switch 86-14002-02, 115VAC, 65W, 60Hz, Appears Unused *MUST SEE* picturePressure Switch 833488 NSN: 5930008841615
$29.95
Pressure Switch 833488 NSN: 5930008841615 picture






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