labelField unfocus background color

I add a few labelField focusable on color management, when compiling with jre 4.7 or later version, it is ok, but with 4.5 labelFields background get white color when they are unfocuses.

From memory, there was a change made to LabelField approximately 4.6, so that he could extend over several lines, in which up to 4.5, you may lose this as well.  We could with the labelField autour mud so that it can work in both places, but I would swap that Exchange you using a RichTextField who is not active, since it provides little nearly the same features.

Tags: BlackBerry Developers

Similar Questions

  • Problem to get the background color

    Mr President, in my code, I wasn't able to use fully all the width of the screen,

    This is my code

    public class HorizontalField extends VerticalFieldManager
    {
       HorizontalFieldManager sd=new HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH);
       HorizontalFieldManager r1=new HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH);
       MySeparatorField ds=new MySeparatorField();
       Font fnt,fntv;
        HorizontalField()
        {
           fnt = this.getFont().derive(FontFamily.SCALABLE_FONT, 14);
           fntv = this.getFont().derive(FontFamily.SCALABLE_FONT, 11);
           r1.setFont(fntv);
           /*---------------------Heading-----------------------------------*/
           DateField dd=new DateField("Date");
    
           dd.setFont(fnt);
           sd.add(dd);
          /*------------------*/
           MyLine s=new MyLine();
           sd.add(s);
           Desp d1=new Desp("Description");
           d1.setFont(fnt);
           sd.add(d1);      
    
           /*_________________*/
           MyLine s1=new MyLine();
           sd.add(s1);
    
           Amt d2=new Amt("Amount");
           d2.setFont(fnt);
           sd.add(d2);
           add(new SeparatorField());
           add(sd);
           add(new SeparatorField());
    
               DateField dfr=new DateField("13.08.09")
               {
                   public void paint(Graphics g)
                   {
                        g.setBackgroundColor(Color.RED);
                        g.clear();
                        super.paint(g);
                   }
               };
               r1.add(dfr);
               MyLine sr=new MyLine();
               r1.add(sr);
               Desp dr=new Desp("Reent")
               {
                   public void paint(Graphics g)
                   {
                        g.setBackgroundColor(Color.RED);
                        g.clear();
                        super.paint(g);
                   }
               };
               r1.add(dr);
               MyLine sra=new MyLine();
               r1.add(sra);
               Amt amtr=new Amt("5000")
                 {
                   public void paint(Graphics g)
                   {
                        g.setBackgroundColor(Color.RED);
                        g.clear();
                        super.paint(g);
                   }
               };
               r1.add(amtr);
               add(r1);
               add(new SeparatorField());
    
           }
    
        }
    
     class DateField extends LabelField
    {
         DateField(String s)
        {
            super(s,LabelField.LEFT);
         }
        public  int getPreferredWidth()
        {
            return Display.getWidth()*2/10;
        }
    
    }
    
      class Desp extends LabelField
    {
         Desp(String s)
        {
            super(s,LabelField.RIGHT);
         }
        public  int getPreferredWidth()
        {
            return Display.getWidth()*5/10;
        }
    
    }
    
      class Amt extends LabelField
    {
        Amt(String s)
        {
            super(s,LabelField.RIGHT);
         }
        public  int getPreferredWidth()
        {
            return Display.getWidth()*4/10;
        }
    
    }
    

    MyLine code is

    public class MyLine extends LabelField
    {
        int width,height;
    
        ButtonField dd;
        MyLine()
        {
            width=1;
            //height=200;
        }
         MyLine(int w)
        {
            width=w;
            //height=200;
        }
    
         public int getPreferredWidth()
            {
                return width;
             }
    
         public void paint(Graphics g)
                {
                       // g.setBackgroundColor(Color.BLUE);
    
                     g.drawLine(0,0,0,70);
                }
    }
    

    When I call this HorizontalField I get the result, but in the amount column (i.e. red) background color I get half of this label, I don't know what problem I did

    Thank you

    The problem is in your calculation of width.

    Your should calculate your width in such a way that (approximate):

    Display.getWidth () = DateField width, width PED, Amt width + 2 * MyLine width;

    Furthermore, a solution may be simply change your constructor Amt class as below:

            Amt(String s)        {                   super(s,LabelField.RIGHT | Field.USE_ALL_WIDTH);        }
    

    Concerning

    Bika

  • 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 background color

    How to change the background color of the label field, how to do it thanks

    I can change the color of labelfield, but I want to change the background,

    How can I do this

    Thank you.

    I do not know mantaker do not want to forget the call to super...

    public void paint (Graphics gs) {}

    gs.setBackgroundColor (0x00FF0000); red background

    GS. Clear();

    Super.Paint (GS);

    }

  • How to set the background color to the Manager?

    I'm working on JDE 4.2.1

    I have a HorizontalFieldManager with fields like this.

    HorizontalFieldManager titleManager = new HorizontalFieldManager (HorizontalFieldManager.FIELD_HCENTER);

    Bitmap image = Bitmap.getBitmapResource("images/test.png");
    BitmapField myBitmapField = new BitmapField (image);

    titleManager.add (myBitmapField);

    titleManager.add (new LabelField ("Documents"));

    MY requirement is to have the background color as blue titleManager. This titleManager is inside another Director.

    If I want to customize, how can I do it?

    Thanks for any help.

    crush paintBackground
    use graphics.setColor and graphics.fillRect to paint you like.

  • 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 can I set different background color for the slider?

    Hello
    I want to set a different color for track Slider, slider track is spitted into two sections by slider-button.
    I want to put a left gray, the right of a white.
    Under css only changes the background of the entire track, but how I can change different background color for the slider?
    Any suggestion?
    .slider {
        -fx-border-width: 0;
    }
    .slider *.track {
        -fx-background-color:white;
        -fx-background-insets:  0, 1;
        -fx-border-color: #faf0e6;
        -fx-border-width: 1;
        -fx-border-style:solid;
        -fx-progress-color:yellow;
        -fx-border-radius: 20;
    }
    .slider.knobStyle:focused .knob {
        -fx-effect: dropshadow( three-pass-box , red , 5 , 0.5 , 0 , 0 );
    }
    .slider.knobStyle:unfocused .knob {
        -fx-effect: dropshadow( three-pass-box , red , 5 , 0.5 , 0 , 0 );
    }
    .slider .thumb {
         -fx-background-color:rgb(224,225,226);
         -fx-background-repeat:stretch;
         -fx-background-size:stretch;
         -fx-background-position:center top;
         -fx-background-image:url("../images/volume_ball.png");
            -fx-padding: 10;
    }

    I don't know why I can't get the node of the track, track has always set to null and the thumb or the other.

    After that the cursor was displayed on an active scene are you doing research?

    (ex.: after you have added the slider to a scene, the scene for scene, then called stage.show ())

  • controlBarContent background color

    Hello

    I have an application like:

    <? XML version = "1.0" encoding = "utf-8"? >

    < name s:Application = "Application_test".

    ' xmlns:fx = ' http://ns.Adobe.com/MXML/2009 "

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/mx".

    backgroundColor = "black" >

    < fx:Script >

    <! [CDATA]

    public void init (): void {}

    load styles

    styleManager.loadStyleDeclarations("styles/styles.swf");

    }

    []] >

    < / fx:Script >

    < s:layout >

    < s:VerticalLayout / >

    < / s:layout >

    < s:controlBarContent >

    < s:VGroup width = "100%" >

    < s:HGroup width = "100%" >

    4 components

    < / s:HGroup >

    < s:HGroup width = "100%" verticalAlign = "middle" >

    "< mx:MenuBar id ="myMenu"labelField="@label ' iconField="@icon" cornerRadius = "10" / > ".

    < / s:HGroup >

    < / s:VGroup >

    < / s:controlBarContent >

    < / s:Application >

    How can I change the background color of controlBarContent?

    I am using styles.

    Thank you!

    I was able to do by using skins.

    Thank you

  • When I turn on my iPhone 6 screen shows only the background color, the icon usage and the reception icon.

    When I turn on my iPhone 6 screen shows only the background color, the icon usage and the reception icon.

    The iPhone's battery is fully charged?  Otherwise, load it, and then try again.

    If it is busy, go in recovery mode as explained here.  You may need to try to get into the mode of recovery once more to succeed.

    If you are unable to update or restore your iPhone, iPad or iPod touch - Apple supports

  • Change background color of page newtab to black.

    I can't change the background color of my page newtab to something other than white that it is today. Navigation in a dark room is extremely blinding, when opening the newtab page. In the past, I modified my file userContent.css with the following (among others):

    @-moz - document url("about:newtab")
    {

    #newtab-scrollbox{background-color:#000000!important;}
    #newtab-window{background-color:#000000!important;}
    

    }

    He has always worked and got the results I want, but given that I have updated to Firefox 42.0 this morning it doesn't seem to work. My background color of the newtab is white broken and is much too bright for my taste.

    I have a strong preference NOT to install additional modules to do this, as it should be easy to do from the userContent.css file. Don't know why my code doesn't work anymore...

    If I take the following in userContent.css, * {background-color: #000000;}, she to obvious effect to all black, including the newtab cell background. This tells me I can put a background, I just need the proper syntax.

    OS: Windows 8.1
    Firefox Version: 42.0

    Thank you!

    Hi, can just try you with the following? :

    @-moz-document url("about:newtab") {
    body{background-color:#000000!important;}
    }
    
  • Just upgraded to 42.0 Firefox and background color setting doesn't work anymore - an empty window is always white.

    I just upgraded to Firefox 42.0 and, unlike previous versions, the setting of background color in 'Content' no longer works. In the settings page, the indicator 'Background colour' changes the color I choose (not white) in the choice of color theme, but each time I open an empty window background color is always white. Then, when I return to the Setup page to verify that the indicator still shows the color that I chose. And I have check the box 'Use the system color' or not there are tick, the result remains the same: the background color of an empty window is always white.

    It is a problem I've never met before. I would like to know why.

    Thanks for any help.

    You can make only one rule:

    @-moz-document url(about:blank), url(about:newtab){ html,body {background-color: #ccc !important } }
  • How can I change the background color of the sidebar bookmarks?

    Grayish brown (I think) background color does not work for me. I'm a little color blind and the cursor to highlight the selected tab is not enough for me to easily see contrast. I found how to change all kinds of colors in FF, but not the background color of the bookmarks bar. I would like to change the background may be blank.

    I have it! My eyes thank you very much for your help!

  • Alternate the background color on and off the toolbar

    Hello

    I have a request. I use Firefox regularly and change the background color in the "content" of the preferences section is easier on my eyes. However, on some sites I would like to disable this function, but I have to go to the preferences it off and then turn it back on once I have leave the site.

    Is it possible for you to make a button that can enable this setting and disable the toolbar? That way if I need to see pictures on a site I can click on the button and then click again to turn it off.

    Kind Regards,
    Bobby
    

    See if this extension - https://addons.mozilla.org/en-US/firefox/addon/toolbar-buttons/ - has the functionality you need.
    Support forum for this extension is here - in case you need to do a custom for your function button:
    https://codefisher.org/Forum/2/

  • background color of slide

    Is it possible to change the background color of slide when using the model 'white '?

    Inspector > Format > then click the bottom dropdown and select the color fill, then click on the color wheel to choose a color. You can also use a color gradient or an image instead of a single color.

  • Background color of bookmarks

    I got the stylish Addon for FF and managed on the base to get the color to the bars, I like but the current bookmark menu back color I can't change the background and the color of the gray menu bar is only correct color of #333333 when it blurry

    I musty red picture with cirle around the areas I want to change the color, I know it is possible that I was using LavaFoxV2 in the years of the reasons he brand the black box, but I want to use the default schema of FF I want just the area I marked in red to be darker.

    #navigator-toolbox {
      background-color: #333333 !important;
    }
    
    .menubar-text,
    #toolbar-menubar .toolbarbutton-text,
    .tabbrowser-tab .tab-label {
      color: #333333 !important
    }

    This is the code I use to get the colors above in the menu bar

    This should cover each of them:

    #menubar-items menu menupopup * {
      background-color: #DDDDDD !important;
      color: #333333 !important;
    }

Maybe you are looking for

  • How to remove the battery on SP M10?

    Hello I have a M10 Pro Sat and the removable battery does not come out.Any idea of what can be done to get it out?

  • How to print on a DVD using a Mac?

    I use a Mac. I bought the camera HP Photosmart to print on DVDs. I can't find any information on how to do it. The instructions says to use the software. What software? There are very little help showing how to set up works of art. After a frustratin

  • drivers WiFi for Windows 7 does not

    the name of my laptop is hp pavillion notebook14 ab154ca and it is not compatible with Windows 7 I tried to install only wifi and network drivers for windows 7 please help because I had serious problems with window 10.

  • Information about the life of the battery of Equium A100-306?

    Hello!I have a Toshiba Equium A100-306 & am pleased with it.Of course, I want to protect my investment & having been, in the past, concerned about battery 'memory', I was happy to find that this machine works with a battery lithium-ion - & everywhere

  • my dvd is battery and does not open after that I tried to install a program.

    Hello I started to install a program on my laptop. The installation did not pass. And the cd is stack on the disc and does not open. On my computer, it does not see the drive that reports to the Conference on disarmament. shows that C; and f: