Questions of formatting LabekField and length

I use areas of labels to display info and lengths are different, how do I preformat so that displays the total length of space for labelling in order to avoid the cut lines to white added while I can't calculate the blank labels Legislative, forcing to view the contents without trailing blanks or preformat the chain to find out how many lines is used to see examples

ex chain is 50 length of RSC

dispalysa part and add the whites and in the other part of the remainig string line I don't want blanks to add just the cut string where the screen do not adapt and then continue on the next line

TKS

Its called Word envelope.  He's trying to do what would Microsoft Word with the text.  You have replaced the space with ".", but spaces are not the only characters after which return to the line will be paid to the chain.  Sorry, I don't know for other languages, but in English, back to the line will split generally after punctuation characters, such as period of '. ', comma ', ', scorecard '-', exclamation point "!" and so on.

As stated above, I do not know any BB text field that won't be NOT Word wrap.  I was hoping that someone else.

Assuming that we can close this off, so I think that you have to use another approach, that is to draw the text yourself.  To do this, you will need to extend LabelField and substitute:

(1) layout() call setExtent with height that you really want to.

(2) getPreferredHeight() to calculate the height you want

(3) paint actually paint the text.

The most important part of this Treaty as follows to determine the height: the following is an example of how this might look like, it of just a sample, has not been compiled and will be definitely defective in some respect.  But it should help you along the way.

Hope this helps

String label = this.getText();
int width = this.getwidth();
Font ourFont = this.getFont();
int height = 1;
String currentLine = "";

for ( int i = 0; i < label.length(); i++ ) {
    currentLine = currentLine + label.substring(i,i+1);
    if ( ourFont.getAdvance(currentLine) > width ) {
        height++;
        currentLine = "";
    }
}

// Now have in "height", the number of lines this text will require

Tags: BlackBerry Developers

Similar Questions

  • APEX 4.0, question about formatting bold and underline in a table

    I use APEX 4.0.
    I see that I can format it "BOLD" and stressed in a textbox control using a control, but when I save it in a clob in the database, using the punctuation of command and not really the underscore or the "BOLD".
    I use a word doc to view the contents of the CLOB, but I just get the punctuation of command and not the true underlining or "BOLD", what am I doing wrong?
    Thanks for your help,
    Doug

    You do NOT record the shape to a column of type CLOB, where the C Lopez (character). If you want to save a document Word style to a column, and then watch a BLOB (Binary)...

    Thank you

    Tony Miller
    Webster, TX

    What happens if you were really stalking a paranoid schizophrenic... They would know?

  • A question about the methods and parameters.

    Hey guys, this is my first post here. I am very new to Java and done a bit of C++ before Java. I had a question about the methods and parameters. I do not understand the methods; I know they can be repeated when it is called, but it's almost everything. I also know that a program should have a class that contains the main method. What I really, really understand on methods is what the parameters are. I know they are in parentheses and that is it. Could you explain what they are? I really appreciate it. Thanks to all in advance. Best regards, Michael

    Taking an example:
    Suppose you calculate area of the rectangle you need two inputs one is the length and the width. Area = l X b, where l = length, b = width

    If your method, say, calculateAreaOfRectangle (length int, int width) will be two parameters as arguments.

    System.out.println ("field of rectangle:" + calculateAreaOfRectangle (40,30);)

    public int calculateAreaOfRectangle (int length, int width) {}
    int area;
    Area = length * width;
    return of area;
    }

    So if you call this method then the output will be returned in 120.

    Parameters of a method are simply the input variables for the method of treatment for all calculations or something useful.

    And we cannot have methods inside the main method in Java. It is in the java syntax and if you do, it will throw a syntax error.

  • Two questions about Camera Raw and Lightroom

    I am now shooting in RAW image format only and catalog images in Lightroom.

    My first question is: how to open an image in Camera Raw from Lightroom? When I right-click on an image in Lightroom, it gives me a choice to edit > Photoshop, but does not not the choice of editing in Camera Raw. In fact, when I'm outside of Lightroom and just double-click on one of these RAW images, it opens in Photoshop. What is going on? Before that I installed Lightroom, a double click on a RAW file would force the latter open in Camera RAW.

    My second question is: Lightroom seems to have all the same controls during processing of a RAW image as does plug in Camera Raw. Does this mean that I no longer need to open images in Camera Raw? I just did all my settings inside Lightroom? I guess that the xmp file is the same as modified in Lightroom or Camera Raw.

    Pleas put me straight on that.

    Thank you

    Ken

    Your second question:

    My second question is: Lightroom seems to have all the same controls during processing of a RAW image as does plug in Camera Raw.

    Responding to your first. Lightroom and ACR share code, rendering you get from Lightroom with the same parameters is therefore exactly the same as in ACR. What happens is that when you say "Edit in Photoshop", ACR is recalled by Lightroom and the development parameters are passed along. ACR then renders the RAW with these settings and open it in Photoshop. Then, because you already have a working for the settings interface, there is no point in showing them to you once again.

    Does this mean that I no longer need to open images in Camera Raw? I just did all my settings inside Lightroom?

    It depends on your workflow. I have more if open images in ACR directly like Lightroom offers a more effective interface in my opinion. Other people I'm sure that prefer the approach of Bridge/ACR.

    I guess that the xmp file is the same as modified in Lightroom or Camera Raw.

    Lightroom is not change the default sidecars. All changes are stored in the database. This allows you to have virtual copies with different parameters of development and more stuff like that. You can have Lightroom write using xmp sidecars "save metadata to file" in menu metadata in library or by turning on the automatic xmp file generation in preferences. There is usually no real point to do this however as "Edit in Photoshop" route works fine. It is really useful when you have a stream of mixed production that still use the bridge. If you share images with others, you are better of DNG, exporter or subsets of images as catalogs with the included images.

  • Firefox Help my firefox top bar has been changed, I used to be able to get the file to bookmarks Format printed, and other services that I have found useful when you take information from the internet, where they went, I want them back?

    Firefox help

       Search
    

    "Found 0 results for" my firefox top bar has been changed, I used to be able to get the bookmarks printed Format file, and other services that I have found useful when taking information from the internet, I found bookmarks to the right of the new game to the top, but it seems not instantly friendly where they went, I want that they come back? »

    See:

  • I forgot my security question answer Apple ID and my recovery email address has since been deleted and disabled. How to get answers to security questions and or change my email recovery?

    I forgot my security question answer Apple ID and my recovery email address has since been deleted and disabled. How to get answers to security questions and or change my email recovery?

    Go to https://getsupport.apple.com . Click on "see all of the products and services ', then 'More', then 'Apple ID', then 'other Apple ID subjects' then 'security issues forgotten Apple ID". If you have problems with this test of this form: https://www.apple.com/emea/support/itunes/contact.html

  • computer crashed, used the backup to restore, formated instead and charged in the State of origin. any chance to recover photos lost at this stage?

    computer crashed, used the backup to restore, formated instead and charged to the State of origin, no chance to recover lost photos at this stage?

    Hello

    It is a good free program to recover data. but no guarantee.

    http://www.Piriform.com/Recuva

    You may need to contact the data recovery specialists, who are very expensive.

    See you soon.

    p.s., You use your computer, the less chance you have of data recovery.

  • I formatted flash and waste of space. help please.

    I formatted flash and waste of space. What can I do?

    Hi DavitGevorgyan,

    ·         You plug the flash drive to another computer?

    Method 1: Connect the flash drive to another computer and see if it shows of the same size.

    Method 2: Format the disk in disk management.

    a. click Start, type diskmgmt.msc , and then press enter.

    b. find the drive. Right-click on it and select format.

  • Question about Powerconnect M6220 and out-of-band/management 8024-K connection

    I'm sorry if this question belongs to another section, but with regard to the functionality of these switches I thought I would start here.

    My question is, the M6220 and 8024-K out-of-band connection are going through the connections on Board (for example port 18 for example) or through connection of the M1000e CMC?

    The reason for this question. We recently vlaned our network and CMC modules are VLAN 8 (10.100.8.0 255.255.248.0) and management of our switches is supposed to be on the VLAN 1 (10.100.1.0 255.255.255.0). I can't ping on the affected IPS (IE 10.100.1.15), but our CMC modules are fully accessible (IE10.100.9.120). Our blades are fully accessible and can access all the VLANS on them (they are the ESX host).

    Finally, I'm sorry if all necessary information has been provided, I'm not so much a networking guru.

    Thoughts?

    Thanks for your help

    The OOB interface is connected to the chassis management controller by the median plane of the chassis. Traffic on this

    port is separated from network traffic operating on the switch ports and cannot be lit or routed to the operational network.

  • Exception in 4.5 "ArticInterface::DocPosToCaret: error 3; formatting of the length of the text = 49; »

    Hi all

    1 work on BB 8300 version Simulator is v4.5

    2 opportunity BB JDE v4.5.0

    3 Ran in the Simulator

    4. the request is:

    I ran the same code v4.2.0 to v4.5.0 base

    While full screen loading, obtained the exception as "class java.lang.IllegalStateException--> ArticInterface:ocPosToCaret: error 3; formatting of the length of the text = 49; »

    Why is this is coming error?

    Thanks in advance

    Ratna

    Sorry above excerpt code was wrong

    Problem is here:

    VFM. Add (new LabelField("\n...text...",Field.NON_FOCUSABLE) {}
    {} public void paint (Graphics g)
    g.setColor (Color.YELLOWGREEN);
    Super.Paint (g);
    }
    });

    I did not this time/runtime code compilation error, but all pushing on the screen, I got the error.

    I don't know why it gives mistake here is the weired behaviour. sort of, I changed labelField to BasicEditField.

    Thank you for your cooperation

  • We can add a button to the BP to approve Budget so that it can read all the charges in question cost journal line and auto fill on the grid.

    Hi all

    We can add a button to the BP to approve Budget so that it can read all the charges in question cost journal line and auto fill on the grid.

    Let's say I have a cost with 5 code cost journal

    Code 1 price

    2 cost code

    Code 3 cost

    Code 4 cost

    Code 5 cost

    BP budget approval, after that I click on New, can I add a button to the tab the line items so that when I click on this button, it reads all codes of cost in the cost journal and auto fill on the grid?

    You can create a new 'model' BP for this purpose. Line item type. Then add a line manually with a cost on each code. Then you can use the copy in your BP BA record consolidate the function to copy the line items to the new folder of BP (including all cost codes) into your folder of BA. That is to set up a model record once with all cost codes and then copy consolidate billing it to all lines new record of BA. would this work?

  • Model number format comma and dot (.) appear as 'u' a bad

    When I saw the pdf at the local level, the number worked well, for example '1000'-> '1 '000.00 '.

    But I run in eBS, the number format do not work, for example, '1000'-> '1u000n00 '.
    I put the number as format below:
    <? format-number: SUM_AMOUNT_D; '9G999G999G999G999D99 '? >

    I also change the format of '9G999G999G999G999D99' to ' #, #, #, #, #. 00'. it still does not work.

    Help, please

    Thank you

    KP

    Model number format comma and dot (.) appear like 'u' and ' don't (Doc ID 760434.1)

  • Questions about the terms and conditions

    Dear team of Adobe Stock,

    I am considering a subscription for an e-commerce site that I am developing. I have a few questions about the terms and conditions:

    3.5 social media use. You can view or download an unmodified version of the book on the Social media Site if (A) you include a notice of copyright in the work itself (© author name - stock.adobe.com) and (B) the terms of use governing the Social media Site do not include any provision that would grant exclusive rights or the ownership of those works or alterations to anyone. "Social Media Site" means a website or application that puts the main emphasis on facilitating social interaction between its users and allowing users to share content in such social interaction

    What I have to insert in each post on social media on behalf of the author? Generally, this information is displayed only for free images. What I have to insert this information even if I signed up for a plan?

    Thank you

    Hello

    Please see the link below for help:

    http://wwwimages.Adobe.com/content/dam/ACOM/en/legal/servicetou/Adobe-stock-additional-ter ms_20160119.pdf

  • I'm lost here.  I left a message in the discussions [4 years PS E7 problems developing -?] and he was moved to the "Forum elements.  I come here and there are about a dozen question back 4 hours and no sign of page numbers.  Not a total newbie to foru

    I'm lost here.  I left a message in the discussions [4 years PS E7 problems developing -?] and he was moved to the "Forum elements. Yes, I was wrong. I come here and there are about a dozen question back 4 hours and no sign of page numbers.  Not a total newbie to forums, but I'm lost.  8-)

    I searched "4 years PS E7 developing problems...» "and couldn't find even in Discussions and notifications that it has been moved.  I would have thought that a search would have led me on the Forum of items with notes as to how much, if any, had read it.  This is what I'm used to.  As I said, I'm lost.  Sorry if it should be obvious, and if I look like a whiner.

    Viewerx wrote:

    Oh, so it has been moved, but still listed in the Discussions?  You could say that.

    When a thread is moved, it will also appear in its place of origin for a short period in order to allow the original poster to find.

    I didn't know where it was posted.  I'm not a moderator and couldn't have moved it.  Only, I went to your profile and watched your activity:

  • Question output formatting

    Hello community! Sorry, it's so rudimentary. Can anyone offer advice on how to better format the output of the below? As it is, it prints it just without formatting - I want out as the output format-table and I would have zero decimal places in the output of Write-Host $CurrentItemHdd.CapacityGB.  Thank you!

    foreach ($VmItem to $MyVms)

    {

    $CurrentItemHdd = get-disk hard - VM $VmItem

    Write-Host $VmItem.Name $CurrentItemHdd.CapacityGB

    }

    To create an exit in your PowerCLI script like the Format-Table output, you must create an output object. There are several ways you can do. One way is to use the PowerShell New-Object as shown in the below script cmdlet. The properties in the New-Object cmdlet output are not classified. That's why I redirect the output to the Select-Object cmdlet to order.

    Your original script will generate a table for the CapacityGB property, if a virtual machine has more than one hard drive. That's why I introduced a second foreach to browse the hard drives. Because you probably want to know that CapacityGB belongs to the hard drive, I added the property 'hard drive '.

    [Math] .NET: Round() function is used to supplement the CapacityGB to zero decimal places.

    The character '&' at the beginning of the script and the scriptblock around the script are necessary to allow to channel the output of the script to another cmdlet as Export-CSV. foreach is not a cmdlet, and therefor you cannot use the out of foreach in the pipeline without using this trick.

    & {foreach ($VmItem to $MyVms)

    {

    foreach ($CurrentItemHdd in (Get-disk hard - VM $VmItem))

    {

    New-Object PSObject-property @ {} TypeName

    VM = $VmItem.Name

    "Hard drive" = $CurrentItemHdd.Name

    CapacityGB = [Math]: Round($CurrentItemHdd.CapacityGB,0)

    } |

    Select-Object - property, CapacityGB VM, 'Hard drive'

    }

    }}

    Post edited by: Robert van den Nieuwendijk

Maybe you are looking for