How to set the font color EditField

Hi guys

Please help me the EditField setting font color.

I'm doing a screen context menu custom for the credentials of the user with a white background. The problem is that when I put background color to white effects all items included in cluding edit fields.

To change the fields, I can not set the color of the font all text contained in them become invisible.

Thank you

Well it seems settled now.

I created a custom class and and overrided the paint method

public class CustomEditField extends EditField
{
private int fontColor = -1;
...
protected void paint(Graphics graphics)
{
    graphics.setColor(fontColor);
    super.paint(graphics);
}

}

see you soon

Tags: BlackBerry Developers

Similar Questions

  • How to set the font color to drop substantial text to a topic only

    I want to apply a different font color for drop-down text for a particular topic only. I tried to change the color through drop down text-> fonts-> font color-> properties apply. The selected color is displayed in the font color, but does not appear when the subject is presented as a preview. The drop-down list text appears in the color applied in style. Would appreciate advice on how to apply the drop-down menu the text color for a specific topic.

    If you have your style sheet saying you drop-down list text is blue, then it will be blue no matter what you do. It's logical. You can try using a different stylesheet for the single subject and changing the drop down to test color accordingly.

  • How can set the background color of the status bar?

    Quote from the old forum:

    Comments: comments
    How can set the background color of the status bar?
    Posted the: July 17, 2008 02:56
     
    How can set the background color of the status bar?
    Using this code for the status bar:
    LabelField statusField = new LabelField ("Good Morning", LabelField.USE_ALL_WIDTH |) LabelField.NON_FOCUSABLE | LabelField.HCENTER)
    {
    int _backgroundColour = Color.LIGHTGREEN;
    public void paint (Graphics g)
    {
    g.setBackgroundColor (Color.RED);
    g.Clear ();
    Super.Paint (g);
    }
    };

    Font defaultfont = Font.getDefault ();
    Police smallfont = defaultfont.derive (Font.PLAIN, 12);

    statusField.setFont (smallfont);
    setStatus (statusField);

    When I ran the code you have above, my status background color was red.  Is not what you see?  If so, please provide the BlackBerry model and software version that you are testing.  You can find this under Options.

    Or if you try to do something else, please provide details.

    I tested this in the BlackBerry Simulator included with version 4.5.0 BlackBerry JDE (4.5.0.44).

    To do this in version 4.1, first call getColor and save the current color.  Then call setColor, setting the color to the color you want to use for the background.  After this call call fillRect, starting with 0, 0 and go to the size of the field (use this.getWidth () and this.getHeight () to get this).  This must fill in the field with your specified color.

    To allow the drawing of the default content of the field call setColor once again, passing in the original color, then call super.paint.

  • How to change the font colors in the communities of support?

    How to change the font colors in the communities of support?

    Thank you

    Press or click on use the Advanced Editor in the upper right of this text block which will take you to it.

  • How to set the font "ARIAL" family in the RichTextField?

    How to set the font "ARIAL" family in the RichTextField?

    I saw a LOF of the sample displayed how set the font family in the RichTextField, such as defined as CBTF_FONT.

    But how can I put it as Arial font? If it cannot be, anyone could list a family table of fonts available for use in the Blackberry?

    You are right, for these devices you can use fonts already on the device.

  • How to set the font size of the title to different screens in fluid layout?

    Build a fluid layout (Responsive Web design), and could I please know how to set the font size of title (h1, h2, h3 etc.) and other mobile police, tab size and wallpapers?

    I use no px values.  I generally use the % font size in the selector body inside my queries.  Adjust the dimensions accordingly.

    / Special rules for mobile phones. */

    @media only screen and (max-width: 481px) {}

    Body {size are: 85 %}}

    }

    / Special rules for tablets * /.

    @media only screen and (min-width: 482px) {}

    Body {make-size: 100% ;}}

    }

    / * Special rules that apply to workstations * /.

    @media only screen and (min-width: 1050px) {}

    Body {make-size: 135% ;}}

    }

    Nancy O.

  • How to set the background color of a page_item?

    I was pasting "background-color: #5CD65C" in a number of places, like the 'attributes of the HTML table cells' under the label and the tabs of the item, but get no results. Can someone tell me how to set the background color of a cell, please?

    Hi Doug,.
    One method is to add a style to your header html in page attributes, if you add the below css styling and the change of the name of the item page (#P2_FIRST_NAME) to your he should style correctly:

    Thank you

    Paul

  • How to change the font color

    as in the subject...

    I have a class that extends the VerticalFieldManager and paint method:

     

    public void paint (Graphics _g) {}

    Super.paint (_g);

    _g.setColor (Color.Black);

    _g.fillRect (0, 0, getWidth(), getHeight());

    _g.setColor (Color.Red);

    _g.drawRect (0, 0, getWidth(), getHeight());

    }

    So what I have is a black rectangle with red edges.

    later in another part of the program, I make an object of this class and I want to add a TextField to write to him. the problem is, the font color is black and is also the background of my rectangle. I want to change the font color in the TextField in white, but I have problems. I tried to crush paint method as follows:

    _Tf TextField = new TextField() {}

    Public Sub paint (Graphics _g)

    Super.Paint (_g);

    _g.setColor (Color.White);

    }

    but it won't help.

    Anyone know how to solve?

    concerning

    Make the call to setColor before calling super.paint (...).  Although you might need to save/restore the current color

    {} public void paint (Graphics g)

    oldColor int = g.getColor ();

    g.setColor (Color.WHITE);

    Super.Paint (g);

    g.setColor (oldColor);

    }

    The color setting is perhaps an exaggeration, but you can play with it.  I remember in the past where I had put the red label text, then a bunch of controls designed after it was all red.

  • How to change the font color under block Action workflow history?

    Hi all

    How can we change the font color to Blue(see attachment) to the Red under history of Oracle Workflow Action block.

    In my scenario, the user has launched good order to the approver. He goes to the first approver. First approver enters his observations and approvers it. PO goes to the second approver for approval. now when the second approver opens the notification, it should be able to see the comments made by the first approver in red instead of blue.

    In short every time that comments are those should visible in red once stored.

    SR.png

    Try to set the CSS class.

    I do not remember exactly where this region is generated. Check the Message in the workflow and see how this region is rendered.

    If it's HTML, you must define tags, if there is an OA region, you must customize the OA region and add a CSS class on the ground.

    See you soon

    AJ

  • How to change the font color of taskbar

    How can I change the color of the font of the taskbar? The white letters for minimized windows are impossible to read.

    Hello cheesechief,

    Thank you for visiting the Microsoft answers community.

    As SharonMary has previously said, there is not a configuration option to change the font color in the taskbar. Although there are many third-party applications that can help you accomplish what you're after, simply start looking for them.

    Hope this helps

    Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk

    Chris.H
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How to set the background color of an application in bbui.js?

    How can I set the background color of an application that uses the bbui.js?

    his does not work just to put a:

    body {
        background-color: #000000;
    }
    

    It is even easier than... just create the style or the class on your screen

  • How you set the font style and size as the norm for the e-mail that is sent and received?

    I, too, have this problem. Am using Outlook.

    Separated from -.

    https://answers.Microsoft.com/en-us/Windows/Forum/windows_8-desktop/how-do-you-set-the-font-style-and-size-as-the/d48a95c5-68a1-4766-873d-d9924004feab

    Outlook policies can be changed in options.

    1. On the file menu, click Options
    2. Go to the mail section, and then click stationary and fonts
    3. Choose your fonts

  • How to change the font color in live movie maker 2011

    I'm used to using movie maker on vista, but this movie maker is very different.  I need to change the font color...

    Help, please

    There is an 'A' with the word 'Police' below it... left up until it clicks.

    See the following links:

    Windows Live Movie Maker to add titles & credits
    http://windowslive.com/Tutorial/MovieMaker/TitlesCaptionsCredits/video

    Video 101: Adding text & titles with Windows Live Movie Maker
    http://Vimeo.com/videoschool/lesson/29/video-101-adding-text-and-titles-with-Windows-Live-Movie-Maker

  • How to set the background color of the title?

    Generally, the title background color is black and the other area of the main screen is white. I want to set the background color of the linear gradient background as blue or something. I try the following 2 ways, but there is always a black line at the bottom of the title bar.

          Background background = BackgroundFactory
                    .createLinearGradientBackground(0x00ff0000, 0x00ff0000,
                            0x0000ff00, 0x0000ff00);
            LabelField title = new LabelField("Hello World Demo",
                    LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
            title.setBackground(background);
            setTitle(title);
    
           LabelField title = new LabelField("Hello World Demo",
                    LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
    
            HorizontalFieldManager hrzManager = new HorizontalFieldManager() {
                protected void paintBackground(Graphics graphics) {
    
                    graphics.setBackgroundColor(0x00382B79);
                    graphics.clear();
                    super.paint(graphics);
                }
            };
            hrzManager.add(title);
            setTitle(hrzManager);
    

    Hello

    I think that there may be a problem using the default setTilte() method.

    Have something by default, behavior with the device.

    It may be a way to customize the default title to remove the black line at the bottom of the title bar.

    But I suggest an alternative that will behave like the title bar without using the setTitle() method.

    You can use something like below to get your condition.

    import net.rim.device.api.ui.*;import net.rim.device.api.ui.component.*;import net.rim.device.api.ui.container.*;import net.rim.device.api.system.*;
    
    class TestScreen extends MainScreen{
    
        private VerticalFieldManager verticalManager;    private HorizontalFieldManager hrzManager;
    
        TestScreen()     {            super(NO_VERTICAL_SCROLL);
    
            LabelField title = new LabelField("Hello World Demo",                        LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
    
            hrzManager = new HorizontalFieldManager()         {            protected void paintBackground(Graphics graphics)             {                graphics.setBackgroundColor(0x00382B79);                graphics.clear();                super.paint(graphics);            }        };        hrzManager.add(title);        this.add(hrzManager);
    
            //rather than  adding component in the mainScreen        //add components in this verticalManager and then        // add this manager to mainScreen          verticalManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR)        {            /*              public void paint(Graphics graphics)            {                graphics.setBackgroundColor(0x00ffffff);                graphics.clear();                super.paint(graphics);            }            */                        protected void sublayout( int maxWidth, int maxHeight )            {                int width = Display.getWidth();                int height = Display.getHeight() - hrzManager.getHeight();
    
                    super.sublayout( width, height);                setExtent( width, height);            }        };
    
            ButtonField button1 = new ButtonField("Button1");        ButtonField button2 = new ButtonField("Button2");        ButtonField button3 = new ButtonField("Button3");        ButtonField button4 = new ButtonField("Button4");        ButtonField button5 = new ButtonField("Button5");
    
            verticalManager.add(button1);        verticalManager.add(button2);        verticalManager.add(button3);        verticalManager.add(button4);        verticalManager.add(button5);        this.add(verticalManager);
    
        }}
    

    Concerning

    Bika

  • How to set the width in EditField

    I have my customEditField, and I put my 40 width and height using (Font.getHeight), to calculate the height. I set the max characters no. 3 when I enter 3 characters in the EditField, I see 3 characters I typed in editfield in simulaors as Pearl curve, but I couldn't see all the 3 characters in 8900, I see 2 characters only, so how do I set the width of my editField

    How can I do this?

    (i) if I have the same width, how can incase I do horizontal scrolling in my edit field

    (II) without using the scroll option, how can I determine my editfield based on my characters length maximum width (i currently use only 3 characters to type here and I need its respective width).

    Concerning

    Rakesh Shankar.p

    Agree with Stephen, here is a code which may help

    int this.getFont ().getAdvance("000") = width;

Maybe you are looking for