Custom main screen does not properly perform fields center

I have a CustomMainScreen, but it is not completely central, field layout (they are a bit too left when Field.FIELD_HCENTER is applied to the field)

Screenshot:

Code:

this.label_field = new CustomLabelField("Welcome to Test App",Field.FIELD_HCENTER);
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.component.LabelField;

public class CustomLabelField extends LabelField
{
    private int _newcolor = Color.BLACK;
    private Font _font = Font.getDefault();

    public CustomLabelField(String label)
    {
        super(label);
    }

    public CustomLabelField(String label, long field)
    {

        super(label,field);
    }

    protected void paint(Graphics graphics)
    {
        graphics.setColor(this._newcolor);
        graphics.setFont(_font);
        super.paint(graphics);
    }

    public void setColor(int newcolor)
    {
        this._newcolor = newcolor;
    }

    public void setFont(Font newFont)
    {

    }
}

Thank you!

The code you have looks like it must be placed correctly, with a slight concern:

graphics.setFont (_font);

By doing this I think that you can change the font size.  Now the LabelField will already told the Manager how big it is, and it will be based on the police, he said.  You change it.  I assume that you make it smaller.  So presumably the LabelField has been fitted out with a larger font, your smaller font does not fill the space.

However, you do not want to set the font in your object, that the definition of the police may cause to the new provision, which will cause a repaint, which will set the police, resulting in a new provision, another painting,...

Then try something like this:

SerializableAttribute public class CustomLabelField extends LabelField
{
private int _newcolor = Color.BLACK;
_font private policies = Font.getDefault ();

public CustomLabelField (label As String)
{
Super (label);

this.setFont (Font.getDefault ());
}

public CustomLabelField (label As String, long field)
{
Super (label, Field);

this.setFont (Font.getDefault ());
}
....

If this doesn't help, can you say what Manager you add this?

Tags: BlackBerry Developers

Similar Questions

  • ADF Mobile: Custom Login screen does not work

    JDEV: Build JDEVADF_11.1.2.4.0_GENERIC_130219.1415.6370

    I replaced the default connection as a result of my own using:

    I copied the default page to deploy folder public_html Application Controller.

    Then changed all references of javascript to... /... /.. /www/ and it looks similar to the following:

    "< script type =" text/javascript"src ="... /... /.. / www/js/base.js "> < / script >"

    "< script type =" text/javascript"src ="... /... /.. / www/js/phonegap-1.0.0.js "> < / script >"

    "< script type =" text/javascript"src ="... /... /.. / www/js/adf.mf.device.integration.js "> < / script >"

    The deployment of the app for the ipad:

    The login screen comes up with the following on this subject error message:

    Unable to load the JSON resources: js / profile - login.json: empty response

    Error: a profile is required to configure the basic page

    If I use the default page, then it works fine.

    No idea what is happening here?

    Vik

    OK, so the documentation missed the point that all the css and js are necessary to be copied as well with folder www login page.

    After having done that it solved the problem

  • I accepted the last update. Now, I can not display to the right of the main Itunes store, where top songs, etc would be. As the screen does not. Only on the HOMEPAGE of ITUNES STORE! Help!

    I accepted the last update. Now, I can not display to the right of the main Itunes store, where top songs, etc would be. As the screen does not. Only on the HOMEPAGE of ITUNES STORE! Help! I've tried everything. Google it. Searched through itunes, etc. It MUST be a bug, because it started right after I accepted the 12.3.3 update on my laptop running Windows 7 32.

    I count on the part of the main screen, which is not. Its strange. PLEASE HELP ME! In addition to the main page of the Itunes Store, everything else works fine as before. Music from my library work screens, etc.

    I also have exactly the same problem since the last update. Tried to find a way to solve the problem but no luck. Someone please help!

  • PowerShot SX50HS screen does not except when in the custom 1 and 2 settings

    screen does not except in the custom 1 & 2 settings.  I turn the dial to the next setting appears on the display but turns black as soon as it is fully in the new context.

    It come back when you press the display button?

    You can try to do a reset to the settings via the settings menu also

  • When I click and drag a window to move its location on the screen does not move properly.

    When I click and drag a window to move its location on the screen does not move properly. It leaves a "track" of windows. Whatever the problem is scroll is also affected when the page moves in waves. Why he started to do this, and if someone can offer a solution? Thank you!

    original title: "leakage" of windows

    It is a common problem with how XP displays the items on your screen. When things get a bit bogged down, you'll start to see trails of the window as you drag. Unfortunately, there is no solution, but future versions of Windows do not have this problem with a new rendering of the graphics system.

  • Why is my second screen does not work - it starts with my main screen, but then turns off.

    My HP Pavilion P7-1120 Desktop PC does not work with two screens - there 8gig of ram...  1.5 terabyt hard drive, Windows 7 64-bit primary system works via the VGA port, but the second screen does not rest via the DVI port.  The two normal startup with the start-up of information on both screens, then the secondary display stops and I get a message "no signal".  Both monitors worked with my laptop PC and older myDell...

    When I go into the control panel and the view tab - the PC does not recognize the second monitor.

    GEO...

    It's not a problem with my PC or whatever it is in the box.  Cables work on other screens of the RGA and DVI.  There is a problem with my screen - the works of port RGA, is not the DVI port.  Another monitor works properly by the DVI.

    Now fixed.

    TKS for the entry.

    GEO...

  • Custom scan box does not touch "scan" because of my 13 "screen.  Cannot reach it.  How can I fix it?  THX

    Custom scan box does not touch "scan" because of my 13 "screen.  Cannot reach it.  How can I fix it?  THX.

    Try increasing your screen resolution.

  • Acer ft200hql touch screen does not work w / HP Pavilion dv7-5000, Win 7 Pro 64-bit

    After searching for and buying touch screen FT200HQL, it does work with my HP Pavilion laptop dv7-5000, Windows 7, 64-bit.  I have the USB cable is connected (even if it says that it is optional in user's Guide - not an option if you want the touchscreen to work).  I tried it with an Acer, Gateway and an another HP Pavilion laptop (all Win 7), & it works perfectly with them, but not w / mine.  All my drivers are up to date.  (Although there is not driver site Acer for the FT200HQL for Win 7 & I don't think that what they have listed as a driver for Win 8 is a pilot).  A Microsoft Search to ensure the compatibility of the FT200HQL compatible shows and there's nothing I should do.  Help, please!  I really like the monitor & don't want to send again, but I bought it mainly for the touch screen feature.

    Hello Jo,.

    Thanks for posting your question on the Microsoft Community.

    I would like to know some information about the problem so that we can help you better.

    What version of Windows 7 is installed on your computer?

    To check the version of Windows 7 is installed on your computer, please use this link:

    Operating system Windows am I running?

    http://Windows.Microsoft.com/en-us/Windows/which-operating-system

    You can then check the hardware compatibility of the touchscreen with your laptop device.

    See this link:

    http://www.Microsoft.com/en-us/Windows/compatibility/CompatCenter/home

    I suggest you to update the graphics card, and chipset drivers from the manufacturer's Web site.

    Use this link:

    http://h10025.www1.HP.com/ewfrf/wc/softwareCategory?OS=4063&LC=en&cc=us&DLC=en&sw_lang=&product=5051950

    I also suggest you to install the Vista driver in compatibility mode.

    Remove and reinstall this device in the Device Manager. To do this, use the following steps:

    a. right-click on the executable/program of the driver installation file, and then select the Compatibility tab.

    b. click the checkbox before you run this program in compatibility mode for option, and then select Windows Vista from the drop-down list. then try to install the device driver.

    Additional information:

    A touch screen does not work properly after that you resume a computer from sleep mode Windows 7

    http://support.Microsoft.com/kb/2405640

    Windows Touch

    http://Windows.Microsoft.com/en-us/Windows7/products/features/touch

    I hope this information helps.

    Please let us know if you need additional assistance. We will be happy to help you further.

    Thank you

  • My touch screen does not work.

    My touch screen does not work. Sometimes, and other times I have to reboot. I restored my phone, but it still has the same problem. Any suggestions?

    The following information is taken from the HT201406 of the Apple KB article:

    If the screen of your iPhone, iPad or iPod touch does not respond to touch

    If your touch screen responds slowly, inconsistently, or not responding at all, follow these steps.

    Check your touch screen

    Make sure your hands are clean and dry, then try the following steps:

    1. If you have a case or a protective screen on your device, try removing it.
    2. Clean the screen with a soft, slightly damp, lint cloth.
    3. Unplug your unit.
    4. Restart your device. If you are unable to restart it, you can force restart your device.

    If your touch screen is still unresponsive as it should, contact the Support technique Apple or make your tablet in an Apple Store or Apple authorized service provider.

    Adjust your settings for tactile 3D

    If you have an iPhone 6s or later that does not properly respond to tactile 3D press, you can adjust the settings:

    1. Go to settings > general.
    2. Click Accessibility > Touch 3D.
    3. Then set the sensitivity of the setting.

    Get more help

  • Still 2 WT10 - touch screen does not work

    Sometimes the touch screen does not work or malfunctioning, as does replacing the system and continues. When it crashes I have to suspend the Tablet and wait a bit, sometimes I have to play several times to select what I want. Anyone know what it could be?

    Have a Toshiba Encore 2 WT10

    You said; you have already changed the system.
    What did you change? The ENCORE 2 WT10-A-102 was pre-installed with Win OS 8.1.

    Also, I guess the problem described is related to busy BONE.
    Probably too many applications (apps) as well as the process running in the background and this could lead to short a few drop-outs or performance problems.

  • Satellite A60-122: screen does not work - rest black

    Hello!!

    Can someone help me please on a screen problem? I have a Toshiba Satellite A60-122 and when I turn it on the screen does not work. It remains black as if the power of the laptop was turned off. I tried to connect the laptop to an external monitor, but it still does not work. I have no more ideas of what can do to make it work.

    I already told to format the pc with the cd of restoration but without an image, it is impossible to do anything...
    Thank you

    Isabel

    Hello Isabel

    I'm not an expert, but if there is no image on LCD internal display and the external monitor, I assume that there is a problem with the graphics card. I think you should contact the customer Service of your country partner and let check the device.

    I also hope that the warranty is still valid and if something needs to be replaced they will do it for free.

    Bye and let us know if you have more information about it.

  • Keys (Fn + F6 and F7) function to set the brightness of the screen does not work

    original title: Fn + F6 and F7 to adjust the brightness of the screen does not

    The function Fn + F6 or F7 has suddenly stopped working. It has been fine until now, but when I press on them now, nothing happens. I use a toshiba laptop with windows xp, can provide more information if necessary

    Thank you

    Hello

    1 have had any changes made to your computer before this problem?

    2. What is the number of the model of the computer?

    3. the other function keys work as should.

    Perform the steps mentioned below and check:

    Step 1:

    Check if the problem persists when the computer is in clean boot state.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135

    Note: Make sure that you put the computer to Start Normal once you have finished by referring to step 7 in the article.

    Step 2:

    I suggest you perform the steps mentioned below and check if it helps:

    http://forums.Toshiba.com/T5/keyboards-touchpads/fn-key-not-working/TD-p/253131

    (Valid for all models of Toshiba laptops)

    If the problem persists I suggest you to contact Toshiba to get help:

    http://Toshiba.com/Tai/support.jsp

    Let us know if it helps.

  • Aspire One 522 screen does not

    The monitor left on my netbook (Aspire One 522 Windows 7), the machine works when connected to an external monitor. I tried upgrading the BIOS, but the screen does not always react. Anything else I can try before I get another machine for my trips?

    Thank you

    John

    Hi John:

    I had what seems to be the same problem with the AO722. It unfortunately turns out to be a pause that has developed in the display ribbon cable & camera near the hinge area - it's intermittent at first, but eventually the screen cover works (the problem of the famous black screen that is not fixable with a bios upgrade). I was forced to use either an external monitor or TV hdmi to work with the system until I finally took the laptop part (a royal pita, withdrawal plug-in keyboard was the worst part) and replaced the Ribbon by a piece of Amazon.com. The part number of the tape is marked on the Ribbon connector.

    Right now, I try to avoid opening and closing the lid too to reduce stress on the Ribbon near the hinge area - the Ribbon takes a tortuous path in this hinge - I'm surprised that the original lasted as long as he did. Also, I covered the keyboard of the snap-ins with tape is easier to remove if I have to take off again - hope not! I use black tape to tape actually the upper part of the keyboard on the main body of the computer - not noticeable.

    Jack E/NJ

  • My Pavilion dv6 upgraded to windows 10 what happened to my external screen does not

    My Pavilion dv6 upgraded to windows 10 what happened to my external screen does not

    Hi @Jake08,

    Thank you for visiting the HP Forums! A place where you can find solutions for your problems with the help of the community!

    I stumbled upon your post on the laptop and wanted to help you! I looked in your question about your HP Pavilion dv6 Notebook and questions with external screen works not properly. You can try this without the connected external monitor.

    In Device Manager, click the arrow next to display adapters to expand this category
    Right-click on the graph, and then select Update driver software if more than 1 graphic adapter do 1 at a time.
    Select search automatically for updated driver software.

    The laptop must find and automatically install the updated driver
    Once the installation is complete, restart your laptop.

    You can try to use the Windows Update Troubleshooter to fix updates that do not come through Windows 10.  Please restart the laptop twice to make sure that all updates are completed!

    Please let me know how it goes.

    Thank you.

  • Computer takes forever to stop + display does not properly

    Hello

    My computer began to take a long time to shut down (10-15 minutes) and then crashes with blue screen of death...

    Also when it comes on sometimes it loads but I have no display and my screen goes to power saving mode

    If I reboot, it takes forever to shutdown, then crashes, restarts, and the screen does not work until I'm physically hold the power button to turn off and then turn it on again, then the display works fine again. This only started happening in the last day or two, after I did a system restore.

    Any ideas what could be the problem?

    Thank you, Dan

    Hi Dan,.

    ·         You receive an error message or error on blue screen code?

    ·         Did you do changes on the computer before the show?

    Follow the suggestions below for a possible solution:

    Method 1:

     

    Step 1: Start in safe mode and check if the problem persists.

    Start your computer in safe mode

    http://Windows.Microsoft.com/en-us/Windows-Vista/start-your-computer-in-safe-mode

     

    Step 2: If the problem does not occur in safe mode, you can put your system to boot (in normal mode) to solve the problem.

     

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135

     

    Note: After troubleshooting, be sure to configure the computer to start as usual as mentioned in step 7 in the above article.

    Method 2: Please see the following articles for more information on the set of the computer:

    Why my computer won't turn on or off quickly?

    http://Windows.Microsoft.com/en-us/Windows-Vista/why-wont-my-computer-turn-on-or-off-quickly

     

    Demo: Smart ways to turn off your computer

    http://Windows.Microsoft.com/en-us/Windows-Vista/demo-smart-ways-to-turn-off-your-computer

    You can also see the following article for more information on improving the quality of display:

    Ways to improve display quality

    http://Windows.Microsoft.com/en-us/Windows-Vista/ways-to-improve-display-quality

    Let us know if that helps.

Maybe you are looking for