Why all my target areas have blue background

Please tell me how to hide or remove the blue background of my focused fields.

The non-target fields have no blue background.

Thank you

public class SignInScreen extends MainScreen {
    public int displayWidth = Display.getWidth();
    public int displayHeight = Display.getHeight();
    CustomInputField cifUser = new CustomInputField((int)(displayWidth/4), (int)(displayHeight/4), (int)(displayWidth/2), (int)(displayHeight/16), 16, "Username", "Textbox.png");
    CustomInputField cifPW = new CustomInputField((int)(displayWidth/4), (int)(displayHeight/24), (int)(displayWidth/2), (int)(displayHeight/16), 16, "Password", "Textbox.png");
    public SignInScreen() {
        super(Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR | USE_ALL_WIDTH | USE_ALL_HEIGHT);
        VerticalFieldManager vfManager = new VerticalFieldManager(NO_VERTICAL_SCROLL | NO_VERTICAL_SCROLLBAR | USE_ALL_WIDTH | 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.
                Bitmap newBGB = GPATools.ResizeTransparentBitmap(Bitmap.getBitmapResource("bg_pizza.jpg"), displayWidth,displayHeight, Bitmap.FILTER_LANCZOS, Bitmap.SCALE_TO_FILL);
                graphics.drawBitmap(0,0,displayWidth,displayHeight,newBGB,0,0);
                super.paint(graphics);
            }
         };
        HorizontalFieldManager hfManager = new HorizontalFieldManager() {
            // overrides the managers paintBackground method, this draws the background
            protected void paintBackground(Graphics graphics) {
                Bitmap newBar = GPATools.ResizeTransparentBitmap(Bitmap.getBitmapResource("back-bar.png"), displayWidth, displayHeight/10, Bitmap.FILTER_LANCZOS, Bitmap.SCALE_TO_FILL);
                graphics.drawBitmap(0,0,displayWidth,(int)(displayHeight/16),newBar,0,0);
                super.paint(graphics);
            }
            protected void sublayout( int maxWidth, int maxHeight )
            {
                super.sublayout( maxWidth, maxHeight );
                XYRect extent = getExtent();
                int width = Math.max( extent.width, displayWidth);
                int height = Math.max( extent.height, (int)(displayHeight/16));
                setExtent( width, height);
            }

        CustomBitmapField bbfBack = new CustomBitmapField((int)(displayWidth/90), (int)(displayHeight/216),(int)(displayWidth/5), (int)(displayHeight/18), FIELD_VCENTER | FIELD_LEFT | FOCUSABLE, "back-button.png", "back-button-on.png");
        CustomBitmapField bbfForgotPW = new CustomBitmapField((int)(displayWidth*0.45), 0, (int)(displayWidth/3), (int)(displayHeight/16), FIELD_VCENTER | FIELD_RIGHT | FOCUSABLE, "forgot-password-on.png", "forgot-password-on.png");
        CustomBitmapField bbfLogo = new CustomBitmapField((int)(displayWidth/4), (int)(displayHeight/24), (int)(displayWidth/2), (int)(displayHeight/6), FIELD_VCENTER | FIELD_HCENTER, "logo_pizza_onebitedefault.png", "logo_pizza_onebitedefault.png");
        CustomBitmapField bbfSubmit = new CustomBitmapField((int)(displayWidth*0.3), (int)(displayHeight/24), (int)(displayWidth*0.4), (int)(displayHeight/12), FIELD_VCENTER | FIELD_HCENTER | FOCUSABLE, "button_submit_pizza.png", "Submit-button-on.png");
        CustomInputField noAccount = new CustomInputField((int)(displayWidth*0.3), (int)(displayHeight/24), (int)(displayWidth*0.6), (int)(displayHeight/18), 22, "Don't Have an Account?", "No Account");
        CustomBitmapField bbfSignUp = new CustomBitmapField((int)(displayWidth*0.3), 0, (int)(displayWidth*0.4), (int)(displayHeight/12), FIELD_VCENTER | FIELD_HCENTER | FOCUSABLE, "Sign-In-button-off.png", "Sign-In-button-on.png");
        bbfBack.setChangeListener(backListener);
        bbfForgotPW.setChangeListener(backListener);
        bbfSubmit.setChangeListener(submitListener);
        bbfSignUp.setChangeListener(backListener);
        hfManager.add(bbfBack);
        hfManager.add(bbfForgotPW);
        vfManager.add(hfManager);
        vfManager.add(bbfLogo);
        vfManager.add(cifUser);
        vfManager.add(cifPW);
        vfManager.add(bbfSubmit);
        vfManager.add(noAccount);
        vfManager.add(bbfSignUp);
        add(vfManager);
        noAccount.setFocus();
     }
}

package oneBiteScreen;

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Graphics;
/**
 * Button field with a bitmap as its label.
 */
public class CustomBitmapField extends Field {
        private Bitmap b, bitmap, bitmapHighlight;
        private int x, y, width, height;
        public CustomBitmapField(int x, int y, int width, int height, long style, String offBitmap, String onBitmap) {
            super(style);
            this.width = width;
            this.height = height;
            this.bitmap = resizedImage(offBitmap, width, height);
            this.bitmapHighlight = resizedImage(onBitmap, width, height);
            this.b = this.bitmap;
            setPosition(x,y);
        }
        protected void fieldChangeNotify(int context) {
            try {
                this.getChangeListener().fieldChanged(this, context);
                } catch (Exception exception) {
                    }
            }
        protected boolean navigationClick(int status, int time){
            fieldChangeNotify(1);
            return true;
            }
        protected void layout(int width, int height) {
            setExtent(getPreferredWidth(), getPreferredHeight());
        }
        public int getPreferredWidth() {
          return width;
        }
        public int getPreferredHeight() {
          return height;
        }
        protected void onFocus(int direction){
            b = bitmapHighlight;
            invalidate();
            }
        protected void onUnfocus(){
            b = bitmap;
            invalidate();
            }
        protected void paint(Graphics graphics) {
            graphics.drawBitmap(0, 0, width, height, b, 0, 0);
        }
        public static Bitmap resizedImage(String imageName, int width, int height) {
            Bitmap actualBitmap = Bitmap.getBitmapResource(imageName);
            Bitmap resizedBitmap = new Bitmap(width, height);
            resizedBitmap.createAlpha(Bitmap.ALPHA_BITDEPTH_8BPP);
            actualBitmap.scaleInto(resizedBitmap, Bitmap.FILTER_LANCZOS, Bitmap.SCALE_STRETCH);
            return resizedBitmap;
        }
}

Two immediate things:

(1) for your main problem replace drawFocus nothing to do:

protected void drawFocus(Graphics g, boolean on) {
}

(2) onUnfocus is not always called by the framework (it's a bug I've seen several versions of BlackBerry OS). You are much better to use FieldChangeListener for switching of bitmaps depending on the State concentrate/blurry.

Tags: BlackBerry Developers

Similar Questions

  • Why all my Web pages have white background

    When I open IE8 and go to Web pages all Web pages have white backgrounds. I don't know how much more clear, I can say that.

    What happens when you try to restore the system?

  • I started editing in 720 p, that's why all my shots are zoomed. And now, when I changed it to 1080 p, it becomes pixelated.

    I made a very tragic mistake. I started editing in 720 p, that's why all my shots are zoomed. And now, when I changed it to 1080 p, it becomes pixelated.what can I do? Is it possible to fix it? or do I have to re - edit the entire thing yet...

    Hi Please help me for my presentation! Really enjoyed

    [title published by mod]

    You should probably uncheck you scale to the size of the image.

  • Why all the results are duplicated when searching in my bookmarks library?

    If I search for "Shell", for example, and then click on the 'name' column, most of the 'results' are duplicated. For example, "Perdido | On Shell"in the"shell"folder Parent is shown twice... same URL and al. I see that the or after the 01/02/2013 added bookmarks are NOT duplicated.

    In my case, the bookmarks ARE actually duplicated. I checked by exporting and by analyzing the HTML code.
    The whole "All bookmarks" hierarchy had somehow been copied into a random location of my favorite tree. This is why all bookmarks except most recent lie twice.
    It looked like this:

    - All Bookmarks
      + Bookmarks Toolbar
      + Bookmarks Menu
         + MY_FOLDER_A
         + MY_FOLDER_B
         - MY_FOLDER_C
           MY_NESTED_FOLDER_A
             - All Bookmarks
                .... older state fully duplicated!!!
    

    I deleted the nested copy of "All bookmarks" and it seems OK now.
    I made this copy by mistake (which I highly doubt) or a bug caused.

    Good to hear that you are not using Firefox Sync (I use it). It would have been a Prime Minister candidate for causing a problem like this. (My bad favorites have been replicated to all of the computers connected with synchronization).

    The copy of "All bookmarks" should have been made over the past months, but I couldn't determine exactly when. The copies have the same ADD_DATE and LAST_MODIFIED timestamp in the HTML file.

  • during the conversion of several Word and Excel docs in a combined PDF file random pages have blue background in the final PDF file.

    I have a user using Acrobat 10. It has been installed two weeks ago and had no problems at the start. Today, she said that when she tried to convert several word and excel docs by selecting and right-click on it to select convert/combine PDF format, pages randomly in the finished PDF file have a blue background. I did some research online and you can't find any information on this problem. Can anyone here shed some light on this subject and maybe point me in the direction of a solution? Any help is appreciated. Thank you!

    Hi Gilad,

    So something I didn't consider was that it could be a setting in office documents. The reason why I do not consider this was cause we tested several docs and had similar results each time. I returned and examined this possibility and found a setting in word that was causing this problem. Although the word doc showed no color page when opened in word, if I went to the "Page Layout"-> 'Color of Page', a shade of blue was chosen. By selecting "no color", then convert / combining documentation in PDF format, we have achieved the desired result. Thanks again for your response!

  • File navigation on OS x using openDlg() - why all the folders are grayed out?

    I am configuring a file and folder browsing dialog that works for the two Win/OSX and with filters to narrow the search to specific file types dialog box. I received a lot of help from another user on the forum (Matias Kiviniemi) in order to obtain the function of filter working - but now I have another problem: a little strange.

    When you browse the files under OSX, all the folders are greyed out!error.jpeg

    You can always navigate (somewhat) via the Favorites list and directory tree button at the top in the Center, but actually clicking in the records does not at all.

    I also tried saveDlg() to browse the files, but I have exactly the same problem with greyed out records. SaveDlg() is not the second parameter (the filter function) to restrict the dialogue to a specific file type - which is something that I need.

    // Utility functions for checking if the OS is Win/OSX
    function isWindows(){
        return app.systemInformation.indexOf("Operating System: Windows") >= 0
    }
    function isMac(){
        return app.systemInformation.indexOf("Operating System: Mac") >= 0
    }
    
    
    // All params below are strings
    function promptFile(dialogMessage, dialogType, extFilter, oldPath){
    // Description: Opens up a file or older dialog window for browsing (Win/OSX)
    // Returns: Absolute path (string) to the file or folder that was picked by the user
    
    
        // File
        if (dialogType == "file"){
    
    
            // Create filter function for the File.saveDlg -function
            var filter = null
            if (isMac()){ // OSX
                if (extFilter){
                    var filter_regex = new RegExp("[^\.]*\."+extFilter+"$")
                    filter = function (file_entry){
                        return filter_regex.test(file_entry.name)
                    }
                }else{
                    filter = function(){ return true } // All and any file(s)
                }
            }else if (isWindows()){ // Win
                if (extFilter){
                    filter = extFilter.charAt(0).toUpperCase() + extFilter.slice(1)+"-files:*."+extFilter
                }else{
                    filter = "All files:*.*" // All and any file(s)
                }
            }else{
                filter = null
            }
    
    
            // Create file dialog
            var path = new File(oldPath);
            // var dialog = path.saveDlg(dialogMessage, filter); // Same kind of error with saveDlg
            var dialog = path.openDlg(dialogMessage, filter, false);
    
    
        // Folder
        }else if(dialogType == "folder"){
            alert("folder diag:\n" + oldPath);
    
    
            // Create folder dialog
            var path = new Folder(oldPath);
            var dialog = path.selectDlg(dialogMessage);
            while (dialog.alias){
                dialog = dialog.resolve.selectDlg(dialogMessage);
            }
        }
    
    
        if (dialog){
            return dialog.fsName.replace(/\\/g, "/") // Back to Front slashes
        }
    }
    

    I'll cross post since my last response to the other crossed the moderation and released after you posted this (and it is relevant for this topic)

    There seems to be backup dialog boxes _SEVERAL_ versions

    • file_entry.saveDlg (): file_entry content is the default value, but do not know if he has locked her
    • File.saveDialog (): same as file_entry.saveDlg, but none value of screening. Maybe it is not locked to original dir
    • folder_entry.saveDlg (): looks identical to file_entry.saveDlg, do not know if there is a difference.
    • Folder.selectDialog: seems more versatile, "simply to choose a file.

    You probably just do some trial and error to choose one that fits, what are the rules everyone has. So far I think Mac has no option for "create a new file, but only this extension." Extension filter only seems to apply to existing opening and win (although even there, he hides just, you can actually set different extension in her typing).

    Confusion between the part which is the "grayed out of all cases" it would imply in fact wants the filter even though the docs say it is not. I.e. you'd need to do a filtering function that accepts two folders or files with right like below (not tested)

    filter = function (fileSystemEntry) {}

    If {(fileSystemEntry instanceof file)

    Returns true

    } else {}

    return filter_regex.test (fileSystemEntry.name)

    }

    }

  • Why all my images are empty in my HR 10 project?

    I use TC 4, which includes RH10 and FM11.  I have create a HR project. Bind it to my book of FM, then update.

    FM book has been generated from a set of PowerPoint slides, all the slides are in pdf format.  After the update the HR project, all of the images that will be created are empty. I've been googling and try everything I can think of. Is there a log somewhere that tracts the HR process crosses then create and import slides from the PDF?

    If I find an error, then maybe I can fix it.

    Our course development team uses this method for a few years, including me. We have never seen this kind of problem before. Sometimes one or two slides are missing, but it is usually due to a marking that does not like HR and we can find it easily by watching the .htm file, before the question slide.

    I have the latest patches installed. I tried to move my FM book to my C:\ drive to keep the short path.

    We have solved the problem. The problem was caused by incorrect settings in the folder: C:\Users\IBM_ADMIN\AppData\Roaming\Adobe\Adobe PDF\Settings.

    I had two files: ColorIssue.joboptions and FrameMaker.joboptions.

    I deleted ColorIssue.joboptions in the folder Adobe PDF\Settings, forced an update in HR and now images appear as expected.

    When HR runs an update, it uses Adobe Distiller and Adobe Distiller used ColorIssue.joboptions instead of FrameMaker.joboptions for the parameters.

    We use a tool in the House, called the Author class, which applies to special templates to help in the development of courses.

  • Why all my emails are coming as spam in my Inbox skymail

    Why all my emails come as spamin my skymail Inbox

    Ask skymail support.

  • Why all my file extensions have changed ink?

    My computer is almost locked, as all my file extensions have mysteriously changed in INK. I can't do a system restore yet. It's already happened, and I don't remember how I overcame it. Is this a virus? I'm stuck. SOS

    Hello
    Follow the steps described in this guide: http://www.selectrealsecurity.com/fix-programs
    If you have any questions about the instructions, just ask. Let me know if this helps you.
    Brian
  • When I send a picture to Lightroom Develop module, image Navigator shows very well, but not not the image complete.  All I get is a blue background, where the image should be. What is happening with this?  I just installed Lightroom and Photoshop CC on a

    I used Photoshop and Lightroom for years and upgraded to CC about 6 months ago.  I just got a new computer and downloaded Lightroom and Photoshop CC on the new machine.  In Lightroom, when I send a picture to the develop module, all I get is a blue screen, where the image should be.  The navigation signs and develop panels show very well, but the image does not appear on the main screen.  It appears in the browser.  What's up with that?

    Disable the CPU graph use in the performance of the LR preferences tab. Blue box will be gone, Image will show.

  • Why all my desktop icons have changed in PDF format when I installed the drive?

    I just installed Adobe Reader and all my desktop icons have changed and nothing does not open.  How can I fix?

    Hey carolq123,

    Could you please check the below mentioned KB doc for the same link:

    Application, the icons of file change icon Acrobat/Reader

    Let me know if it helps.

    Kind regards

    Ana Maria

  • Why all my widgets are in Spanish?  My preferences are defined in English.

    All my widgets are in Spanish.  My preferences are defined in English.  WTH?

    The language for most widgets is determined by the language set for the page. By default, the Site properties define the language for the whole site match the language used for the interface user of Muse (defined in the preferences). You can change this (in the properties of the Site) If you want. From here the language of the page can be overridden per page (or on the master pages) in Page Properties, if necessary.

  • Why all the new Comps have film as the background?

    It's the weirdest thing that ever happened to me.

    I'm working on a lower third animation project, creating animations on a small clip. Now whenever I create a new publication, it comes with this video clip as if it were the first background layer, but there is no layer, there is nothing. I have nothing to add to the mix yet!

    Screen Shot 2016-06-24 at 2.34.14 PM.png

    Purge all the cache memory and disk. You will find in the Edit menu.

  • Why all the videos are scrambled. not clear

    When you view the videos or ads they are all scrambled, & is not clear. My os is linux zorin are the correct settings? Many thanks allan

    You can attach a screenshot?

    Use a type of compressed as PNG or JPG image to save the screenshot.

    You can have zoomed pages by accident.
    Reset the zoom of page on pages that are causing problems.

    • View > Zoom > reset (Ctrl / command + 0 (zero))

    You can try the following steps in case of problems with web pages:

    You can reload webpages and ignore the cache to refresh potentially stale or corrupt.

    • Hold down the SHIFT key and click the Reload button
    • Press 'Ctrl + F5' or 'Ctrl + Shift + R' (Windows, Linux)
    • Press 'Command + shift + R' (Mac)

    Clear the cache and cookies only from Web sites that are causing problems.

    "Clear the Cache":

    • Edit > Preferences > advanced > network > content caching Web: 'clear now '.

    'Delete Cookies' sites causing problems:

    • Edit > Preferences > privacy > "Use the custom settings for history" > Cookies: "show the Cookies".

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem.

    • Put yourself in the DEFAULT theme: Firefox/tools > Modules > appearance
    • Do NOT click on the reset button on the startup window Mode safe
  • Why all my photos are including icloud photos in my Album on my new iPhone 6 s

    Hi guys

    I could ask a stupid question, but I just got the new iPhone 6s 64gig. I upgraded from 5.

    Since having the phone, I took a photo to test the live picture feature (which works fine)

    All of a sudden to have 1 photo in my album I have 1500 pictures, and and a whole bunch of other albums like Selfies and Panoramas, etc..

    I know for a fact that I downloaded these pictures a while I'm sure that they have been transferred to iCloud and back (imported into iPhoto and delete).

    But now they are all back on my new camera?

    Can someone help here? Maybe I would like to know what's happening, or how I can fix this problem.

    Thanks in advance all the way to Cape Town

    Ernie

    The photos that are in iCloud Photo automatically synchronize on all devices that share the same ID to iCloud.

Maybe you are looking for