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);
}
}

Tags: BlackBerry Developers

Similar Questions

  • 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 set the screen resolution to 1280 x 1024 in windows 7

    Separated from this thread.

    How can I set resolution 1280 x 1024 in my homepage google chorme.

    Hello

    Change your screen resolution
    http://Windows.Microsoft.com/en-us/Windows7/change-your-screen-resolution

    For other settings in course of the Chrome check with his support.

    Support for Google Chrome
    http://www.Google.com/support/chrome/

    Google Chrome forums
    http://www.Google.com/support/forum/p/chrome?hl=en&utm_source=HC&utm_medium=LeftNav&utm_campaign=chrome

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • How to set the screen resolution to insert content on monitor

    original title: content not fit screen

    the format is too big for the screen

    3 methods...

    1. set DPI:
    Right-click on a free space of the desktop > customize > column to the left, adjust the size of police (in PPP) > uac prompt > click default scale (96 DPI).

    2. resolution:
    Right-click on a free space of the desktop > Personalize > Display Setings > move the slider to adjust the resolution.
    Check your user manual, see if she tells you what resolution is for your
    computer.

    Here is a table of the guide line:


    3. do a system restore. Choose the date when your screen was in good
    size as your restore point.

    Start button > Search box, type system restore > press the Enter key > uac prompt > click on choose a different restore point > next > select dates as your restore point, until the click > next > finish
    To sit and wait. The machine restarts when it's done.

    Note: in case the images that appear on your screen are too large for you to implement the methods above, go in Mode safe and run these suggestions.

    Here's how to get safe mode:

    Shut down your computer > turn it back on and immediately and repeatedly press F8 key until you see a black and white screen. The top/down arrow and select Safe Mode
  • How to set the screen resolution to fit monitor

    original title: monitor

    I have a large screen, but it seems as if it was a waste of money because I don't get to use the middle of the screen. Can someone tell me please how to get full use out of my monitor? do I need some sort of version beta or something?

    Your description is not very clear, are the main steps to configure your display:

    -Make sure you have the latest drivers for your graphics card & monitor installed Windows 7 .

    -Search in the manual of your monitor and find out what the native resolution & refresh rate are for example (1920 x 1080 @ 60 Hz), then go to:

    Start-> Control Panel-> display

    and together that view you these settings.

    -If you have black borders around your screen, you should increase the size of your screen through the software installed normally with your graphics card. For a basic card ATI look for a feature called overscan/underscan. Look for the option to increase the size of the desktop in the nVidia Control Panel for nVidia cards. For othe graphics cards check support manual/website for advice.

  • How to set the screen resolution?

    Original title: on screen display with the unused space on the sides

    It is probably so basic, but my display is not full screen, even if I put it in full screen. There is an inch of space black unused screen on each side of the screen. What should I do?  Thanks in advance

    Hello

    You're probably not using the correct resolution, IE: you use a display standard aspect ratio when you have a widescreen monitor. This can be corrected in the settings/personalize/display of the Control Panel, adjust the slider to resolution here.

    Good luck, Rick Rogers, aka "Crazy" - Microsoft MVP http://mvp.support.microsoft.com Windows help - www.rickrogers.org

  • How to set the screen resolution and font size?

    I turned on my computer and it suddenly opted for the super big characters such as when it is running in safe mode. I entered the customization and tried to change the DPI (dots per inch) and it is said that I already use smaller size icons and only gives me the opption to makes them bigger. I restarted several times and have had no joy, so any help would be much appreciated... TTFN

    Assuming that you do not use Vista...

    >I entered the customization and tried to change the DPI

    Have you changed to 96 DPI ?

    In any event my suggestion is do a system restore. Choose a datebefore you had this problem as your restore point.

    Start button > Search box, type system restore > press the Enter key > uac prompt > click on choose a different restore point > next > select dates as your restore point, until the click > next > finish
    To sit and wait. The machine restarts when it's done.

    For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

  • How to set the password for the screen saver?

    When connecting, password is not necessary and I put it under 'control userpasswords2', but I'd like to set password within the screensaver 15 minutes idle.

    Anyone have any suggestions on how to do it?
    Thanks in advance for your suggestions

    Hello

    You will need to set a password for the connection on your computer user account.

    After that, you can set the screen saver and set the option on the resumption, the logon screen and specify 15 Minutes to time waiting .

    Concerning

  • How to set the default zoom according to the screen in Linux level?

    Starting from the same account, I can use different types of screens: low and high DPI. I would like to have the font size (and more generally, the zoom level) right of each screen.

    To set the default zoom level, you can set the layout.css.devPixelsPerPx, but we can't define it it fixed-value, which is not OK, because I would like that the value depends on the environment (as for the font size in the menu which is always OK, because it depends on the resource Xft.dpi X 11).

    Note: I have several profiles, while it is not even possible to write a wrapper that could modify the prefs.js file, because I don't know in advance which file would I need to change.

    What can I do?

    One possibility would be to use the mozilla.cfg file in the Firefox program folder.
    This file can contain JavaScript that runs with full chrome privileges and it it not difficult game of the pref layout.css.devPixelsPerPx to a correct value for the screen currently attached.
    You will need to know how to calculate the dimensions of the screen.

  • My window size is about 1/4 "wider than my monitor screen. How to set the size of the window?

    My window size is about 1/4 "wider than my monitor screen. How to set the size of the window?

    Hello

    ·        You did it changes on your machine before this problem?

    ·        You have a LCD or TFT monitor?

    Usually in LCDs, there will be an option to set the button of the screen on the monitor resolution.

    You can also follow these links for the resolution of the monitor & check if it helps.

    Change the resolution of your monitor

    To change your screen resolution

    Hope the helps of information. Please post back and we do know.

    Concerning
    Joel S
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How to set the size of my screen?

    Original title: maintenance

    How to set the size of the screen

    Norm 21

    How to set the standard for screen size 21

    Resolution:
    Right-click on a free space of the desktop > Personalize > Display Setings > move the slider to the left or right to set the resolution. Check your user manual, see if she tells you what resolution is for your computer. My laptop is using 1280 x 800 pixels.

    Here is a table of the guide line:

    You can also try this method...
    Re - set DPI:
    Right-click on a free space of the desktop > customize > column to the left, adjust the size of police (in PPP) > uac prompt > click default scale (96 DPI).

    For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

  • How to set the background Transparent

    Hi all

    I'm very new to blackberry development, can someone tell me how to set the background transparent.

    Thank you

    Kishore P.

    Use this code:
    VFM VerticalFieldManager = new VerticalFieldManager () {}
    //...
    }
    vfm.setBackground (BackgroundFactory.createSolidTransparentBackground (Color.COLOR_YOU_LIKE, 0));

  • 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 set the background image in the window title?

    Hello

    I am a beginner in flex. I use Flex 4.

    Can someone give me some advice on how to set the background image in the title window?

    Is it possible to do?

    Thank you.

    Hello

    Check the code in the example below


    http://ns.Adobe.com/MXML/2009.
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/mx" minWidth = "955" = "600" minHeight >
       
           
       

       
    @namespace s "library://ns.adobe.com/flex/spark";
    @namespace mx "library://ns.adobe.com/flex/mx";

    s | {BorderContainer
    background - image: embed(source="image/wheres_the_green_rez.jpg");
    background-image-fill-mode: clip;
    }


       
           
       

    Kind regards

    Anitha

  • How to set the time that my screen stays on?

    How to set the time that my screen lights up.  I have an iPod Touch 6?

    Settings > general > auto-lock

Maybe you are looking for