Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 10
Registered: ‎07-04-2011
My Device: 9300
My Carrier: Blackberry

Bordered Edit Field

How to create a custom EditField  having a outline border...?

 

Please help me with some idea or code..?

 

U can mail me at umesh.p@techtreeit.com

 

 

Thanks & Regards

Umesh P. Isran

Mobile Application Developer

Super Contributor
Posts: 273
Registered: ‎11-23-2010
My Device: 9800 torch
My Carrier: Software Programmer

Re: Bordered Edit Field

hi try this code:

override editfield

and use this one

    protected void paintBackground(Graphics graphics) {
        graphics.setColor(Color.WHITE);
        graphics.fillRect(0, 0, getWidth(), getHeight());
        graphics.setColor(Constants.CustomFieldsColor);
        graphics.drawRect(0, 0, getWidth(), getHeight());
        graphics.setColor(Color.BLACK);
    }

 i think this will be helpfull

Contributor
Posts: 10
Registered: ‎07-04-2011
My Device: 9300
My Carrier: Blackberry

Re: Bordered Edit Field

hi... thanx for ur quick answer.. it was really useful..

 

I have 1 more doubt... how shall i use a backgroundcolor for my screen..

 

I am able to do this but the only problem is m unable to display fields on my colored bg..?

 

 

Super Contributor
Posts: 273
Registered: ‎11-23-2010
My Device: 9800 torch
My Carrier: Software Programmer

Re: Bordered Edit Field

in paint method use

 

g- is a graphics object

super.paint(g);

Developer
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: Bordered Edit Field

Here is a knowledge base article dealing exactly with this task:

TextBoxField revisited

This one deals with multiline vertically scrolling bordered text box. If you need a one-line horizontally scrolling one, here is another article:

One-line text input field

Both articles have some comments discussing all kinds of enhancements - read them and the code inside and try to analyze and understand it rather than simply cupying to your project.

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!