Background LabelField

I LabelFields a couple on a background that is a bitmap, but the text is really hard to read. I would like to make a background for them so that I can put a couple LabelFields inside a white box and have several white boxes of information to the bottom of my screen.

A bit like this except not side by side and only one color: white.

http://www.schillmania.com/projects/dialog2/

Can someone tell me if this is possible and how?

Hello

Take a look at this thread

http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=34631&query.ID=11...

http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=336&query.ID=1175...

Please let me know if your problem is solved or not.

Tags: BlackBerry Developers

Similar Questions

  • LabelField with background bitmap file

    I would like to show a LabelField with a background as (01.gif, the yellow circle is the bmp and the labelField is '1'). My code is as follows:

    final Bitmap bmp = Bitmap.getBitmapResource("img/circulo_numero.png");
    LabelField lblPaso = new LabelField("1", Field.FIELD_RIGHT) {
        protected void paintBackground(Graphics g) {
            g.drawBitmap(0, 0, bmp.getWidth(), bmp.getHeight(), bmp, 0, 0);
            super.paint(g);
        }
    
        public int getPreferredWidth() {
            return  bmp.getWidth();
        }
    
        public int getPreferredHeight() {
            return bmp.getHeight();
        }
    
        protected void layout(int width, int height) {
            super.layout(width, height);
            setExtent(Math.min(width, bmp.getWidth()), Math.min(height, bmp.getHeight()));
        }
    };
    

    However, I got results as indicated in 02.gif...

    How can I solve this problem?

    TIA,

    Yamil

    Sorry, I'm not your post earlier. In any case, here is an explanation:

    Your number 1 is painted where LabelField wants to paint. Unfortunately, you don't try to control where he went to paint it or where it will be placed, by the way. Fortunately, there is an old creation of mine tailor-made for you. Here it is:

    Re: ButtonField with background

    Simply create a CenteringManager with the bitmap you want to use as a background, add your LabelField and enjoy.

  • 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.

  • How to set a background image

    HY guys, I'm trying to set a background image on a Blackberry screen. I used this code, but the image dousen can't cover the full screen. Can someone me say what the problem is, or give me an example of how's done it? package mypackage;

    SerializableAttribute public class BackgroundImage extends UiApplication
    {
    Imagearriereplan private bitmap;
    fieldBitmap private bitmap;
        
    Public Shared Sub main (String [] args)
    {
    BackgroundImage PAP = new BackgroundImage();
    theApp.enterEventDispatcher ();
    }
        
    public BackgroundImage()
    {
    The background image.
    Imagearriereplan = Bitmap.getBitmapResource ("loginBackground.png");
            
    Display display = new MainScreen();
            
    HorizontalFieldManager horizontalFieldManager = HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH | nouveau HorizontalFieldManager.USE_ALL_HEIGHT) {}
                
    Override the paint method to draw the background image.
    public void paint (Graphics graphics)
    {
    Draw the background image, then paint.
    graphics.drawBitmap (0, 0, 240, 240, Imagearriereplan, 0, 0);
    Super.Paint (Graphics);
    }
                
    };
            
    The LabelField will be visible through the transparent image.
    LabelField labelField is new LabelField ("is a label");.
            
    A bitmap with a transparent image field.
    The background image will be visible through the transparent BitMapField image.
    BitmapField bitmapField = new BitmapField (Bitmap.getBitmapResource ("field.png"));

    Add the handler to the screen.
    mainScreen.add (horizontalFieldManager);
            
    Add the fields to the Manager.
    horizontalFieldManager.add (labelField);
    horizontalFieldManager.add (bitmapField);
            
    Tap on the screen.
    pushScreen (mainScreen);
    }
    }

    Thanks in advance

    You can scale the image with EncodedImage, but it is usually best to use an image with a sufficient size

  • Background image on the User Interface

    I'm trying to place a background behind my screen of the application image. So instead of the usual white, there would be a "background.png". I am following this thread with the blackberry API set

    http://supportforums.BlackBerry.com/T5/Java-development/drawing-bitmap-in-mainScreen-background/m-p/...

    So far, I tried to apply it within my own application, with the code to start as follows:

    final class UserInterfaceScreen extends MainScreen {
        HorizontalFieldManager _fieldManagerTop;
        VerticalFieldManager _fieldManagerMiddle;
        HorizontalFieldManager _fieldManagerBottom;
        BitmapField _bitmap;
        Bitmap _canadaImage, _ukImage, _usImage, _backgroundBitmap, _fieldBitmap;
        LabelField _label;
        BasicEditField _input;
        String _canadaCapital, _ukCapital, _usCapital, _capital;
        int displayed = 0;
    
        public UserInterfaceScreen() {
            super();
            LabelField title = new LabelField("User Interface Sample",
                    LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
            setTitle(title);
    
            HorizontalFieldManager _horizontalFieldManager = new HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH | HorizontalFieldManager.USE_ALL_HEIGHT){
    
                //Override the paint method to draw the background image.
                public void paint(Graphics graphics)
                {
                    //Draw the background image and then call paint.
                    graphics.drawBitmap(0, 0, 640, 900, _backgroundBitmap, 0, 0); //240
                    super.paint(graphics);
                }            
    
            };
            _backgroundBitmap = Bitmap.getBitmapResource("background.png");
            _fieldManagerTop = new HorizontalFieldManager();
            _fieldManagerMiddle = new VerticalFieldManager();
            _fieldManagerBottom = new HorizontalFieldManager();
    
                add(_horizontalFieldManager);
                add(_fieldManagerTop);
                add(new SeparatorField());
                add(_fieldManagerMiddle);
                add(new SeparatorField());
                add(_fieldManagerBottom);
    

    Basically, I'm trying to combine the thread above with the user interface tutorial.

    http://supportforums.BlackBerry.com/T5/Java-development/user-interface/Ta-p/442781

    The question is when I run the code, I just get the background image, none of the other content is displayed in the foreground. I am this approach correctly?

    I'm not sure the solution you received one will work - it may well do, but the approach is different from what I do.  I based my image of background processing around comments in this article:

    http://supportforums.BlackBerry.com/T5/Java-development/MainScreen-explained/Ta-p/606644

    But if you look at what you said your screen, you will see why you don't see all your real fields.

    The first thing that you add to your screen is as follows:

    HorizontalFieldManager _horizontalFieldManager = HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH | nouveau HorizontalFieldManager.USE_ALL_HEIGHT) {}

    You said this Manager to use the full height and width.  Then what place is left for any other Manager/field.

    You only add this option to provide abackground.  So actually, to do this, you must you add all your fields and managers in this HFM.  Otherwise that will expose after this one (which, as noted way they have no space to display in). I think you'll see something, if you replace this:

    Add (_horizontalFieldManager);
    Add (_fieldManagerTop);
    Add (new SeparatorField());
    Add (_fieldManagerMiddle);
    Add (new SeparatorField());
    Add (_fieldManagerBottom);

    with

    Add (_horizontalFieldManager);
    _horizontalFieldManager.Add (_fieldManagerTop);
    _horizontalFieldManager.Add (new SeparatorField());
    _horizontalFieldManager.Add (_fieldManagerMiddle);
    _horizontalFieldManager.Add (new SeparatorField());
    _horizontalFieldManager.Add (_fieldManagerBottom);

    But it probably won't be good, so you should follow the advice given in the previous Post or see the KB article.

  • Static background with VerticalFieldManager

    Hello, I would like to set up a background image for my application, where it must not move even when the user scrolls... I found the following code on the internet for this type of Manager:

    package com.kruger.workflow.gui;
    
    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.system.Display;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    
    public class BGVerticalFieldManager extends VerticalFieldManager {
        Bitmap mBgBitmap = null;
        int mBgWidth = -1;
        int mBgHeight = -1;
        int mBgX = -1;
        int mBgY = -1;
    
        public BGVerticalFieldManager(Bitmap background) {
            super(USE_ALL_WIDTH | USE_ALL_HEIGHT | VERTICAL_SCROLL
                    | VERTICAL_SCROLLBAR);
            mBgBitmap = background;
            mBgWidth = mBgBitmap.getWidth();
            mBgHeight = mBgBitmap.getHeight();
            mBgX = (Display.getWidth() - mBgWidth) >> 1;
            mBgY = (Display.getHeight() - mBgHeight) >> 1;
    
        }
    
        protected void paintBackground(Graphics graphics) {
            paintBackgroundBitmap(graphics);
            invalidate();
        }
    
        private void paintBackgroundBitmap(Graphics graphics) {
            if (null != mBgBitmap) {
    
                int x = mBgX
                        + getHorizontalScroll();
    
                int y = mBgY
                        + getVerticalScroll();
                 graphics.drawBitmap(x, y, mBgWidth, mBgHeight, mBgBitmap, 0, 0);
            }
        }
    }
    

    However, does not work... I get the following results:

    As you can see the image begins to scroll backwards...

    The use of this Manager is:

    Bitmap bitmap = Bitmap.getBitmapResource("1.jpg");
            add(mContainer = new BGVerticalFieldManager(bitmap));
            for (int i = 0; i < 100; i++) {
                mContainer.add(new LabelField("List item #" + String.valueOf(i)));
                mContainer.add(new SeparatorField());
            }
    

    Although no result so far... When debugging the code, I noticed that this line:

    if (null != mBgBitmap) {
    
                int x = mBgX
                        + getHorizontalScroll();
    
                int y = mBgY
                        + getVerticalScroll();
                 graphics.drawBitmap(x, y, mBgWidth, mBgHeight, mBgBitmap, 0, 0);
            }
    

    Always returns 0 for both a XY is not assumed that getVerticalScroll or getHorizontalScroll must return aware of gap between the container Manager.? How can I fix this?

    Thank you very much.

    I use a VOR with USE_ALL_HEIGHT and NO_VERTICAL_SCROLL and set the background image to it (using the BackgroundFactory since 5.0)

    in this optimization of resources, I put a second, but it work with VERTICAL_SCROLL. The listfield (or any content) is put there.

  • Put LabelField above BitmapField

    I searched around, but have not found a clear answer to this. The answers that are closer seem complicated for what should be a very simple thing to do

    What is the easiest way to place a LabelFeild on top a BitmapField? Specifically, I have the splash screen that takes the entire screen with a BitmapField, and I want to place a small LabelField in the lower right, on top of the Bitmap image. Am I crazy to think that this should be easier?

    I wrote once a code only one field of centers on a bitmap.  Change it to put the box down below is trivial. Here is the link to the code:

    ButtonField with background

    It is in the solution post. Watch the childX and childY calculations and remove the division by 2.

  • Problem with the background color setting

    Hello

    I have the following code

    public class Loading_Menu extends MainScreen {
        public Loading_Menu()
        {
            MainScreen newScreen = new MainScreen(Manager.NO_VERTICAL_SCROLL|Manager.NO_VERTICAL_SCROLLBAR);
            VerticalFieldManager backgroundManager = new VerticalFieldManager(Manager.USE_ALL_WIDTH|Manager.USE_ALL_HEIGHT)
            {
                protected void paint(Graphics graphics) {
                    graphics.setBackgroundColor(Color.BLACK);
                    graphics.clear();
                    super.paint(graphics);
                }
            };
            Bitmap appLogo = Bitmap.getBitmapResource("Breakout_Logo.png");
            BitmapField bmf = new BitmapField(appLogo, BitmapField.FOCUSABLE)
            {
                protected boolean navigationClick(int status, int time)
                {
                    Main_Menu myMethod = new Main_Menu();
                    myMethod.createAndDisplayMainMenu();
                    close();
                    return true;
                }
            };
    
            int leftMargin = (Display.getWidth() - bmf.getBitmapWidth()) >> 1;
            int topMargin = (Display.getHeight() - bmf.getBitmapHeight()) >> 1;
            bmf.setMargin(topMargin, 0, 0, leftMargin);
            add(bmf);
            newScreen.add(backgroundManager);
        }
    }
    

    My goal is to show the bitmap in the center of the screen and have a black background behind the image. in its current form the image shows in the Center, but the screen remains white. Can someone explain and point out my mistake?

    Thank you

    Hi Peter,.

    no problem, here is how I solved the problem. I just added an override of the method paint and this placed in a vertical field Manager

    VerticalFieldManager backgroundManager = new VerticalFieldManager(Manager.USE_ALL_WIDTH|Manager.USE_ALL_HEIGHT|Manager.NO_VERTICAL_SCROLL|Manager.NO_VERTICAL_SCROLLBAR)
            {
                protected void paint(Graphics graphics) {
                    graphics.setBackgroundColor(0x0000A2E8);
                    graphics.clear();
                    super.paint(graphics);
                }
            };
    
            LabelField lb = new LabelField("Hello");
            backgroundManager.add(lb);
    
            add(backgroundManager);
    
  • How to change TextColor of LabelField

    Hello

    I want to change the color of the text of the LabelField

    I tried following code.

    _labelField = new LabelField ("Email") {}
    {} public void paint (Graphics graphics)
                   
    graphics.setColor (Color.WHITE);
    Graphics.Clear;
    Super.Paint (Graphics);
    }
    };

    but it shows me a white box instead of LabelField
    I don't want to change the background color

    Is it possible without using CustomLabelField?

    Hello

    Thanks for the Suggestion

    But I myself found the solution by playing

    with the paintground method and paint as suggested by you (Simon_hain)

    Here is my solution

    _emailLabel = new LabelField ("Email", LabelField.USE_ALL_WIDTH |) LabelField.NON_FOCUSABLE) {}
    {} public void paintBackground (Graphics g)
    g.setBackgroundColor (Color.WHITE);
    g.setGlobalAlpha (0);
    g.Clear ();
    Super.Paint (g);
    }
    {} public void paint (Graphics g)
    g.setColor (Color.WHITE);
    g.setGlobalAlpha (255);
    Super.Paint (g);
    }
    };

    Thanks for the suggestion

  • Bitmap and background

    Hi, I have the following code, which shows a screen with a green background and text. I would like to place a small image in the Center, under the text. I placed the bitmap image in the code, but it does not appear. My code is as follows:

    Hi, ash_1987uk

    I just run your code with the following modifications, and it works for me.

    //BitmapField bmf2 = new BitmapField(logoBitmap2, BitmapField.FOCUSABLE);//add(bmf2);MainScreen newScreen = new MainScreen(){    Bitmap logoBitmap2 = Bitmap.getBitmapResource("football.png");    int imgWidth = logoBitmap2.getWidth();    int imgHeight = logoBitmap2.getHeight();    int imgXPos = (Display.getWidth() - imgWidth) / 2;    int imgYPos = (Display.getHeight() - imgHeight) / 2;    int imgTop = 0, imgLeft = 0;                public void paint(Graphics graphics)    {        graphics.setBackgroundColor(Color.FORESTGREEN);        graphics.clear();        // draw bgImage here....        graphics.drawBitmap(imgXPos, imgYPos, imgWidth, imgHeight, logoBitmap2, imgLeft, imgTop);        subpaint(graphics);    }};LabelField labelField = new LabelField();
    
  • a LabelField can blink?

    a LabelField can blink? And if so, can she blink during an interval?

    Cheers...

    This code might help.

    http://supportforums.BlackBerry.com/T5/Java-development/repeating-background-color-change/m-p/104938...

  • How can set the background of the screen

    I was going through all the thread related to this issue in this form, but could not be a good solution. I want to set the background color of the screen (main screen) and add fields on it. I found the solution for background coloring, but not fields not displayed after staining.

    With the help of the Simulator: 7290

    Code of CELITE (and jfisher) to blackberryforums.com
    http://www.BlackBerryForums.com/developer-forum/89940-mainScreen-background-color.html

    class ExtendedCustomMainScreen extends CustomMainScreen {}
    {ExtendedCustomMainScreen()}
    Super();
    Rtf RichTextField = new RichTextField ("This is a readonly textfield", Field.READONLY);
    LabelField helloWorld = new LabelField ("Hi jfisher! ');
    Add (rtf);
    Add (helloWorld);
    }
    }

    class CustomMainScreen extends form {}

    Private VerticalFieldManager _container;

    {CustomMainScreen()}
    Super (Manager.NO_VERTICAL_SCROLL |) Manager.NO_VERTICAL_SCROLLBAR);
    setTitle ('Test');

    VerticalFieldManager internalManager = new VerticalFieldManager (Manager.NO_VERTICAL_SCROLL |) Manager.NO_VERTICAL_SCROLLBAR) {}
    {} public void paintBackground (Graphics g)
    g.Clear ();
    Color int = g.getColor ();
    g.setColor (0xc0dce0);
    g.fillRect (0, 0, Display.getWidth (), Display.getHeight ());
    g.setColor (color);
    }
    protected void sublayout (int maxWidth, maxHeight int) {}
    Field titleField = getMyTitleField();
    int titleFieldHeight = 0;
    If (titleField! = null) {}
    titleFieldHeight = titleField.getHeight ();
    }

    int displayWidth = Display.getWidth (); I would probably make these global
    int displayHeight = Display.getHeight ();

    Super.sublayout (displayWidth, displayHeight - titleFieldHeight);
    setExtent (displayWidth, displayHeight - titleFieldHeight);
    }

    };
    _container = new VerticalFieldManager (Manager.VERTICAL_SCROLL |) Manager.VERTICAL_SCROLLBAR);
    internalManager.add (_container);
    Super.Add (internalManager);
    }

    public void add (field) {}
    _container. Add (field);
    }

    {} private field getMyTitleField()
    Delegated official = getDelegate();
    Field titleField = null;
    try {}
    titleField = delegate.getField (0);
    }
    {} catch (IndexOutOfBoundsException ioobe)
    //
    }
    Return titleField;
    }
    }

    class MainScreenWithBackgroundMain extends UiApplication {}

    Public Shared Sub main (String [] args) {}
    MainScreenWithBackgroundMain app = new MainScreenWithBackgroundMain();
    app.enterEventDispatcher ();
    }

    {MainScreenWithBackgroundMain()}
    Screen ExtendedCustomMainScreen = new ExtendedCustomMainScreen();
    pushScreen (screen);
    }
    }

  • How to make a black background for a horizontalFieldManager?

    I have a custom HorizontalFieldManager that bears a label for the field. I want the background of the black horizontalField Manager. How can I do?

    Please help me...

    Unless you develop only for 4.6 + devices, setBackground won't help you (this set appeared in 4.6.0).

    The cleanest way will be

    protected void paintBackground(Graphics g) {
      int prevBgColor = g.getBackgroundColor();
      g.setBackgroundColor(Color.BLACK);
      g.clear();
      g.setBackgroundcolor(prevBgColor);
    }
    

    However, you also want to ensure that the text on your LabelField is visible, as prash_bb_dev pointed out.  Either have the LabelField use, say, white background (same solution in a different place, replace Color.BLACK with Color.WHITE ) or indeed set white color inside of object and call the super.paint ().

  • 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

  • Button screen bitmap PopUp do not use opaque background

    I have a custom button png I created, it includes an opaque background. I use this button anywhere in my app and it works perfectly in the normal screens. However when I put them in the custom context menu screens, the opaque turns into a white color. I need to solve this problem. Please tell me any code you must see. Thank you!!

    I think the problem might be in the substantive Manager, it's here for a normal screen:

    this.getMainManager (.setBackground)
    BackgroundFactory.createBitmapBackground (Bitmap.getBitmapResource ("background1.png")));

    This is for a pop-up screen:

    () this.setBackground
    BackgroundFactory.createBitmapBackground (Bitmap.getBitmapResource ("backgroundProfile.png")));

    For the pop-up screen, I can't use getMainManager(), and when I try to use getManager() gives me a nullPointer exception.

    Please help, thanks

    I mentined about that I wasn't convinced thuis was your problem, the important thing that I told you about PopupScreen was how to find the NManager.

    That said, some of your code LabelField seems wrong:

    Protected Sub paint (Graphics Graphics) {}
    graph.fillRect (0, 0, getWidth(), getHeight());
    graph.setColor (Color.RED);
    Super.Paint (Graph);
    }

    You have not set a color for the first fillRect, so it will be whatever color the LabelField normally use, who is black.  So I think you're just lucky that your code works.

    In the LabelField PopupScreen you added

    graph.setBackgroundColor (Color.BLACK);

    This in fact has no effect on the fileRect, but is effective the next graph.clear (), and then it will take your Bkacground color.

    I would recommend that you change these two areas to do the following, which I think will give you black backgrounds and red text in both cases:

    LabelField t1 = new LabelField ("Example")
    {

    Protected Sub paintBackground (Graphics Graphics) {}

    try {}
    graph.setBackgroundColor (Color.BLACK);

    Graph.Clear ();

    }
    Protected Sub paint (Graphics Graphics) {}
    graph.setColor (Color.RED);
    Super.Paint (Graph);
    }
    };

    If you make this change and corrects LabelField, perhaps a similar change will fix your buttons?

    In fact, to make sure that your code has no effect in Sweden, I would like to change your code as follows:

    LabelField t1 = new LabelField ("Example")
    {

    Protected Sub paint background (Graphics Graphics) {}

    int currCol = graph.getBackgroundColor ();

    try {}
    graph.setBackgroundColor (Color.BLACK);

    Graph.Clear ();

    } {Finally

    graph.setBackgroundColor (currCol);

    }

    }
    Protected Sub paint (Graphics Graphics) {}

    int currCol = graph.getColor ();

    try {}
    graph.setColor (Color.RED);
    Super.Paint (Graph);

    } {Finally

    graph.setColor (currCol);

    }
    }
    };

Maybe you are looking for