right-aligned a BasicEditField within the screen

Hello

How do your right justify a BasicEditField in a screen?

If you do the following, framed in any case left field shows:

Processes = new BasicEditField ("process", 7, Field.FIELD_RIGHT);
This.Add (processes);

If you create a LabelField, you can right-aligned it on the screen with this:

This.Add (new LabelField ("Login al sistema", LabelField.FIELD_RIGHT));

TKS.

I wrote my own...

import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.component.EditField;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.HorizontalFieldManager;

public class JustifiedEditField extends HorizontalFieldManager implements FieldChangeListener {

    LabelField lf;
    EditField ef;
    int dw = Display.getWidth();
    int rightMargin;

    public JustifiedEditField(String label, String value, int maxChars, long style) {
        super(USE_ALL_WIDTH);
        ef = new EditField(null, value, maxChars, style) {
            protected void onDisplay() {
                update(0);
            }

            protected void update(int d) {
                super.update(d);
                int efw = getFont().getAdvance(super.getText());
                setPosition(dw - efw - rightMargin, 0);
            }
        };
        ef.setChangeListener(this);
        lf = new LabelField(label);
        add(lf);
        add(ef);
    }

    public LabelField getLabelField() {
        return lf;
    }

    public EditField getEditField() {
        return ef;
    }

    public String getText() {
        return ef.getText();
    }

    public void setRightMargin(int m) {
        rightMargin = m;
    }

    public int getRightMargin() {
        return rightMargin;
    }

    public void fieldChanged(Field field, int context) {
        invalidate();
    }

}

Tags: BlackBerry Developers

Similar Questions

  • I can get to resize the display bar at the bottom right. It extends off the screen. Help, please?

    I can get to resize the display bar at the bottom right. It extends off the screen. Help, please?

    Irene

    Have you tried the resize in the window upper right button.  There are 3 buttons, we close the window one he minimized no date limit it and the other allows to switch between full screen and a smaller screen.  Click on the last one and see what happens.

  • Firefox loads, icon on the bar of tasks but when you click the slide of graphics off to the right, but does not fill the screen & when you right-click again, falls back into the icon

    Firefox, Thunderbird and Quicken were active when I loadad & ran a slot machine game. When I left the game & click on icon to return to Firefox full screen, I could see the flash of the image to the right of my screen and disappear. When I clicked on the icon in the taskbar, the reverse happened - the image flashed from the right down to the icon. When I hover the mouse over the icon, the open screens appear with the red X to close, but the same thing happens when I click on this box. Two other programs that have been opened, while the game was active work correctly, only Firefox has been affected. I can't open the program to access one of the menu items that I can't get the image of the screen on the monitor. I did uninstall and reinstall a freshly downloaded copy, I had to use IE, as I am now) but with the same results when I run. I did chose to save my settings, so if something has changed here so maybe that's the problem.

    Hello

    Try Firefox Safe mode to see if the problem goes away. Safe mode is a troubleshooting mode, which disables most of the modules.

    (If you use it, switch to the default theme).

    • You can open Firefox 4.0 + in Safe Mode holding the key SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • Or open the Help menu and click on the restart with the disabled... modules menu item while Firefox is running.

    Once you get the pop-up, simply select "" boot mode safe. "

    If the issue is not present in Firefox Safe Mode, your problem is probably caused by an extension, and you need to understand that one. To do this, please follow article Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems .

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.

    When find you what is causing your problems, please let us know. It might help others who have the same problem.

    Thank you.

  • The right click menu remains on the screen on top of all applications until I re start System. It can be a 'Open link in a new tab' or 'stick '.

    This happens not all the time, but it often happens.  I right click and click on something, say save the image under or tonight was to add to the dictionary and it will stay on the screen after the action has been completed.  I have to restart the computer so that it can get and it remains on all screens.   It seems to happen when I'm on Facebook and any browser that I use.  The image below shows what happened tonight.  Thank you

    Jyslinn

    Have you tried "refreshing" of the screen (access keys vary by machine but is ofter F5)?

    Please run a check of system files (SFC) 


    All instructions are in our Wiki article below...
    If you have any questions please ask us for .

  • Pushing the right aligned field value to the left

    Hi guys,.

    I have a question about good alignment. I have a form with legend and supposedly, points as filler for the space between the legend and the value. I can stalled right value and I replaced the space with points by program, but if the value is too long, the field is cutting values instead of the fill hole (making the left position as the anchor rather than upright.) IMO, if it's just aligned, the anchor point must be to the right instead of the left.

    Can someone help me with this problem? Thank you!!

    For example.


    subtitle 1:... Value1

    subtitle 1:... V1WWWWW < WW > (value obtained cut points overlaps with the legend)

    subtitle 1:... V1 (if the value is too short, there is space between the legend)

    PS: or if you can give a different approach in the empty space between the legend and the value of filling with dots, it is also a pts 10 suggestion if it works. Thank you!!!

    Not sure I can send you a sample that shows the number of

    [email protected] and I'll take a look.

    Paul

  • Now, the screen moves as the surface is larger than the actual size of the screen. I checked its display options, but how do I disable this screen oversized?

    Hello

    My mother was a member of the family to try to help inrease size but Bobo and now its screen in any program or simply from bottom of screen size is larger than the size of the screen.  She can move the mouse to the left to bring the extreme left veiw and then the same thing right but never have all the screen in veiw now.  How to restore to normal for her.  I tried control - display, but not... help her please help me

    Hi M Carmel,

    Thanks for posting in the Microsoft community.

    I understand that you are facing the issue with the resolution of the screen display.

    I suggest you to see the links and check.

    Change the resolution of your monitor

    http://Windows.Microsoft.com/en-us/Windows-XP/help/Setup/change-monitor-resolution

    Change your screen resolution

    http://Windows.Microsoft.com/en-us/Windows-XP/help/change-screen-resolution

    Please follow these recommended steps, review the additional information provided and after back if you still experience the issue. I will be happy to provide you with additional options available that you can use to get this resolved.

  • The screen backwards.

    My son hit ctrl/alt/delete when the computer froze, he lost consciousness for a second and then returned with everything on the scree backwards.  I rebooted several times, run a full scan of the system, but I now have to use the monitor upside down.  When the computer starts, the flying windows icon in the right seat, but when when the screen's upside.  Ideas?  Thank you

    CTRL-Alt-top. If this does not work, you can have an applet of control panel for your video card (ATI Catalyst Control Panel, Nvidia) which will have a place where you can change the rotation of the screen. If this does not work, the video card could be dead. But try the easy fixes first and let me know if you need more information. MS - MVP - Elephant Boy computers - don't panic!

  • in normal mode, the page disappears off the coast of the right side of the screen. This does not happen in full screen. What can be done to correct the report to the screen to normal screen?

    version 5 loaded on windows 7. all went well for a while. one day, using, normal screen ratio doubled in width; that is half of the page disappears off the screen to the right (on a widescreen). When applied full-screen mode, the ratio is very good. It only happens in normal mode, which is the generally preferred option. I can't determine all means within the program to resize the normal screen. nothing else is affected, only mozilla firefox in normal mode. not when the program is opened from keyboard page is correct for a moment, and then increases the width with 1/2 page dissappearing.

    This problem may be caused by the extension of the toolbar of Babylon 1.1.8

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions of the origin of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

  • alignment has shifted to the right

    I use firefox 5.0.1. Since yesterday, it seems that the alignment of firefox is shifted to the right. all websites have evolved to the right and do not display properly. Also all the tabs do not appear on the screen. They do not fit as the number of tabs is increasing.
    I installed quick time yesterday and it seems the problem started after that. I uninstalled quicktime and reinstalled firefox. I installed the old version of firefox and it worked very well, and Web sites were displayed properly. But later I upgraded again to 5.0.1 version and the problem comes back. Can someone help?

    This problem may be caused by the extension of the toolbar of Babylon 1.1.8

  • Photosmart 6520: Where are right and left arrows to scroll to the bottom of the screen?

    How to scroll the screen to align my cartridges in the Tools section. . The only instructions I see say to use the left and right arrows to do this, but I have no idea where the arrows are, and they do not appear in the instruction book where he shows the parts of the screen. Thank you

    Hello

    I do not know where to find you the appropriate instructions. You can use the printer screen or software on your computer

    To align the printer from the printer display
    1. from the home screen, tap the settings icon and then tap Tools.
    2. on the Tools menu, tap and slide your finger vertically to scroll through the options, and then tap printer align.
    3. follow the instructions on the screen.

    To align the printer from printing software
    ▲ Do one of the following depending on the operating system you are using.

    On Windows:
    a. in your desktop Start menu, click all programs, HP.
    b. click the HP Photosmart 6520 series folder, click HP Photosmart 6520 series.
    c. under impression, double click on maintain your printer.
    d. on the device Services tab, double-click Align the print heads.

    On Mac:
    ▲ the HP utility open, click on align and then click Align again

    Source: page 28 user's Guide.

    Kind regards.

  • The screen on the monitor HP slipped two inches to the right.

    The screen on my HP monitor display slipped to the right of two inches and an inch down off the screen, the screen remains empty. How I've seen to restore the correct alignment?

    Hello

    It should normally have an automatic reset on most monitors button to fix this problem.

    If that does not, you could ask the HP SupportForums.

    http://h30434.www3.HP.com/PSG/

  • Printer print, when I print documents to the right side of the document gets cut it does not finish what was on the screen.

    When I print documents to the right side of the document gets cut it does not finish what was on the screen.  This happens on all documents.  I don't know what to do.  I got a HP Photosmart Premium and he did it so I thought it was defective and bought a HP 7520e all in one and it does the same thing.

    Hello

    All changes made to the computer before the show?
    Method 1:
    See the link, run the Fixit and check.
    Diagnose and automatically fix problems printing and printer
    http://support.Microsoft.com/mats/printing_problems/en-us
    Method 2:
    If the methods above do not solve the problem you can check this link and follow the steps.
    Printer in Windows problems
    http://Windows.Microsoft.com/en-us/Windows/help/printer-problems-in-Windows
    Method 3:

    Try to adjust the alignment on the other side. Follow the steps.

    1. Click Start.
    2. Choose Control Panel.
    3. Choose a printer.
    4. Choose preferably to the printer.
  • Align the planning of block of text to the width of the screen

    I want to show the text and some menu items perfectly aligned in the upper part of a wide screen.

    There is an example of what I mean at the top of this message compose the page with bread at the top left and the menu at the top right. In the case of the page I see the guy on the left is much larger than the type on the right, so I want the baseline of the line upwards across the screen.

    It's pretty easy using CSS and Dreamweaver, but I can't figure out how to get the same effect on the edge of reflow.

    Not quite if I followed exactly your problem, so I tried three ways to show how to keep the text alignment bottom even when they are of different sizes. I have the Margin, Padding and line height. Check out the project attached reflow to see.

    Download the project: https://creative.adobe.com/file/0484eb2d-b3bc-431d-98a9-865d51cb448a

  • How to align in the middle of the screen flash content in the browser?

    I'm currently building a cs5.5 using AS2.0 flash site. One of the pages is 1024px wide by height of 1536. I want the display to only show that the first half of the screen and then the user must scroll down using the browser scroll bar to see the second half of the screen.

    Here is the html code. I changed the "overflow" hidden to auto so that the site is drop-down. However when I saw the Web site in the browser, it is aligned to the left. Even if below (highlighted in red) it says "medium". This isn't what I want, I want the site me aligned in the Middle, so that there is a border of hand and on the other Web site. I tried several things to fix but all without success. Could someone please help. Let me know if you need more information.

    Thank you

    <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > ""

    "< html xmlns ="http://www.w3.org/1999/xhtml"lang ="fr"XML: lang ="fr">"

    < head >

    aboutus < title > < /title >

    < meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 "/ >"

    < style type = "text/css" media = "screen" >

    HTML, body {height: 100%; background-color: #333333 ;}}

    Body {margin: 0; padding: 0;} overflow: auto; }

    #flashContent {width: 100%; height: 100% ;}}

    < / style >

    < / head >

    < body >

    < div id = "flashContent" >

    < object classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width = "1024" height = "1536" id = "aboutus" align = "middle" > "

    < param name = "movie" value = "aboutus.swf" / > "

    < param name = "quality" value = "best" / >

    < param name = "bgcolor" value = "#333333" / >

    < param name = 'play' value = 'true' / >

    < param name = "loop" value = "true" / >

    < param name = 'wmode' value = 'window' / >

    < param name = "scale" value = 'showall' / >

    < param name = "menu" value = "true" / >

    < param name = "devicefont" value = "false" / >

    < param name = "salign" value = "" / > "

    < param name = "allowScriptAccess" value = "sameDomain" / >

    <!-[if! IE] >->

    < object type = "application/x-shockwave-flash" data = "aboutus.swf" width = "1024" height = "1536" > "

    < param name = "movie" value = "aboutus.swf" / > "

    < param name = "quality" value = "best" / >

    < param name = "bgcolor" value = "#333333" / >

    < param name = 'play' value = 'true' / >

    < param name = "loop" value = "true" / >

    < param name = 'wmode' value = 'window' / >

    < param name = "scale" value = 'showall' / >

    < param name = "menu" value = "true" / >

    < param name = "devicefont" value = "false" / >

    < param name = "salign" value = "" / > "

    < param name = "allowScriptAccess" value = "sameDomain" / >

    <!-<! [endif]-->

    "< a href ="http://www.adobe.com/go/getflash' > '.

    "< img src ="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"alt ="Get Adobe Flash player"/ >"

    < /a >

    <!-[if! IE] >->

    < / object >

    <!-<! [endif]-->

    < / object >

    < / div >

    < / body >

    < / html >

    {#flashContent}

    Width: 1024px;
    left margin: auto;

    margin-right: auto;

    }

    Get rid of the 100% w/h and give flashContent fixed wide (1024).

    Then you can give the right and left of auto... centering of the

    .

    Best wishes

    Adninjastrator

  • Right aligned and then centered in the cell of the table - indesign cs 5

    Hi all

    Does anyone know how can I get the numbers right aligned, so the zeros are all below the other. And then the center of the table cell.

    I use a paragraph style is aligned to the right. This is the paragraph defining the cell style.

    Any help would be appreciated.

    Thank you

    Mau

    InDesign CS5

    You can set the position of the tab within the paragraph style, so no, you do not need to edit each cell, but you do not have to use the text aligned to the left, and if you want that all the place line numbers correctly you need to use a font with tabular, rather than numbers proportional to make them all the same width (and for tables rather than oldstyle figures is probably also a better choice).

    When you look at the tabs formatting options that you have left, right, centered and aligned decimals (which can be any character of your choice, but you want the period). When you use the decimal tab aligned, everything you type will behave as if the tab is a tab that is aligned to the right - it will start at the position of the tab and move to the left with each additional character - until you type the character that you chose for the alignment. From there text will move to the right of the alignment. This aims to make things like the columns of numbers with decimals.

    In a table, the tab character is implied, so if the only thing in the cell is your setting of the tab in the style number is sufficient and it will work just as soon as you start typing. If there is other text before alignment numbers that must be the left hard, however, you will need to type, then manually insert a tab in the menu Insert special characters (or create a new shortcut key to insert tabs in tables) to force the text to the left margin and keep the numbers aligned on the decimal point. You can't just hit tab within a cell to add the tab - it reports ID to pass to the next cell.

Maybe you are looking for