How to format the resource string

I have a screen on which I apply the label field. in the label field, I put resource.how string in the format string.

You need to change the font size

Read this

String data = "Hello World!";
compensates for the int [] = {0,5,data.length ()};
Police policies [] = new [] {Font.getDefault ().derive(Font.BOLD,20), Font.getDefault (.derive(Font.BOLD,15))} police;
int bg [] = new int [] {Color.WHITE, Color.WHITE};
int fg [] = new int [] {Color.BLACK, Color.RED ;}
Byte [] = {0,1} attributes;
Add (new ActiveRichTextField (data, offsets, attributes, fonts, fg, bg, 0));

And also you need to change the foreground and background colors.

Hyperlink you must write your own domain,.

This is the sample.

import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.system.Characters;

public class HrefField extends Field
{

    private String content;
    private Font fieldFont;
    private int fieldWidth;
    private int fieldHeight;
    private boolean active = false;
    private int backgroundColour = 0xffffff;
    //private int textColour = 0x333333;
    private int textColour = Color.DARKBLUE;
    private int maskColour = 0xffffff;

    private int buttonId;
    private String buttonName;

    public HrefField(String content)
    {
        super(Field.FOCUSABLE);
        this.content = content;
        fieldFont = Font.getDefault().derive(Font.UNDERLINED);
        fieldWidth = fieldFont.getAdvance(content)+2;
        fieldHeight = fieldFont.getHeight();
    }

    public void setColours(int backgroundColour, int textColour, int maskColour)
    {
        this.backgroundColour = backgroundColour;
        this.textColour = textColour;
        this.maskColour = maskColour;
        invalidate();
    }

    public void setBackgroundColour(int backgroundColour)
    {
        this.backgroundColour = backgroundColour;
        invalidate();
    }

    public void setTextColour(int textColour)
    {
        this.textColour = textColour;
        invalidate();
    }

    public void setMaskColour(int maskColour)
    {
        this.maskColour = maskColour;
        invalidate();
    }

    public void setFont(Font fieldFont)
    {
        this.fieldFont = fieldFont;
    }

    public int getPreferredWidth()
    {
        return fieldWidth;
    }

    public int getPreferredHeight()
    {
        return fieldHeight;
    }

    protected void layout(int arg0, int arg1)
    {
        setExtent(getPreferredWidth(), getPreferredHeight());
    }

    protected void paint(Graphics graphics)
    {

        if (active)
        {
            graphics.setColor(maskColour);
            graphics.fillRect(0, 0, fieldWidth, fieldHeight);
        }
        else
        {
            graphics.setColor(backgroundColour);
            graphics.fillRect(0, 0, fieldWidth, fieldHeight);
        }

        graphics.setColor(textColour);
        graphics.setFont(fieldFont);
        graphics.drawText(content, 1, 1);
       // graphics.drawLine(1, fieldHeight-2, fieldWidth-2, fieldHeight-2);
    }

    public void setButtonId(int buttonId)
    {
        this.buttonId = buttonId;
    }

    public void setButtonName(String buttonName)
    {
        this.buttonName = buttonName;
    }

    public int getButtonId()
    {
        return buttonId;
    }
    public String getButtonName()
    {
        return buttonName;
    }
    public String getLabel()
    {
        return buttonName;
    }
    public boolean keyChar(char key, int status, int time)
    {
        if (key == Characters.ENTER)
        {
            fieldChangeNotify(0);
            return true;
        }

        return false;
    }

    protected void onFocus(int direction)
    {
        active = true;
        invalidate();
    }

    protected void onUnfocus()
    {
        active = false;
        invalidate();
    }

    public static Font defaultFont()
    {
        return Font.getDefault();
    }
}

And in this field navigation, click on connect browser by getting the link of this field.

Tags: BlackBerry Developers

Similar Questions

  • How to format the hard duct under XP?

    How to format the hard drive under XP?

    Hello

    You can format when reinstalling XP or installing another operating system process.

    http://pcsupport.about.com/od/OperatingSystems/SS/instxpclean1.htm

    See you soon.

  • How to format the hard drive and do a clean install of XP?

    I have a legal windows XP profesional version to install and I need advice on how to format the hard disk, the version on it now was apparently a pirate vers.its years since I, did such things and my mind is old so I really need all the steps, a - z,.

    * How can original title - I wipe my hard drive and install win XP Prof? *

    Hi syynbbad,

    In addition to the post of cbarnhorst, please see the following article on how to do a clean install of XP:

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

    I hope this helps!

    Debra
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • How to format the SD card?

    Android 4.0 will erase all data on my phone, right?

    I want to format the SD card, too, because some setting or cache is stored on it as well.  When and how should I do this?

    Here's how to format the sd card
    Settings > storage > unmount sd card > remove sd card

    Don't forget to mark the right answer and the useful answer

  • SQL: how to display the second string of the function in the Jobs table only if the function has more than one string.

    SQL: how to display the second string of the function in the Jobs table only if the function has more than one string.

    Hello

    You can use REGEXP_SUBSTR Oracle/PLSQL: REGEXP_SUBSTR function

    Select the function double REGEXP_SUBSTR('PUBLIC RELATION REPRESENTATIVE ','[^]+',1,2);

    Do you have any value of the column as no 2nd string?

  • How to format the message in the response

    Hi all

    Please let me know how to format the message in the response.
    Sorry this is not the case associated with sql, plsql. I went in the way of asking questions in the forums oracle instructions. But I did not find. Help, please...

    I know this: when I write my thread I use
    .. to format  the code ,but while replying how to include post with formatted text. 
    
    
    Thanks,
    P prakash                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    >

    Thanks for the reply, I would like to know how you included the message formatted in your answer.
    Please let me know this...

    Hi again Prakash,

    Easy - just put ">"at the beginning lines you want to quote. "

    That is higher and space - when you answer, hit the double quotes in the bar
    at the top of the post - last symbol to the right and it will be automatically
    the post to which you want to reply.

    HTH,

    Paul...

  • How to format the code in posts?

    I'm a newbie, need help on how to format the code before posting, appreciate your help, thank you!

    Well, don't worry, you are aware now in only 5 posts. It took me a little longer to find out ;)

  • How to convert the Ascii string containing hex to hex string info?

    Dear all,

    I am busy doing a control/reading program for pumps of ISCO.

    Right now I'm in trouble with to send orders for PUMPS in HEXADECIMAL. When I use a CONTROL to the STRING in HEX display, everything works fine (when I manually write down the command in the control of the chain).

    Exist it a couple of pieces order: string Destination, length, ordering, Checksum. I'm doing a sup - screw that automatically calculates the checksum (modulo 256) and adds it to the string. Everything is going well: first of all, I shared the ascii bytes command and I calculate the checksum and add as ASCII HEXADECIMAL value to the chain of command. Also a CR (= 0d) is added. Now the whole string must be converted to hex. The string contains the right nummers HEX, but they are in ASCII format. Here was I feel worth it, I don't know how to do it!

    So to summarize:

    I have an ascii string that contains the values HEX (for example 315230303652454D4F544531420D) and it must be converted to a HEX string (for instance 3152 3030 3652 454 4531 420 4F54) for the pump of the ISCO can understand the command.

    The VI is attached.

    Thank you in advance,

    Bio

    Bio,.

    This should do what you want.

  • How to detect the resource (find) information?

    Hi all

    I'm trying to detect programmatically information resource name for devices HSDIO PXI and PXI-4130.   How can I do?    System DAQmx property does not include these devices, and I can't find a way to convert a resource VISA name in name of resource HSDIO or NI DC PS formats.  I enclose a code snippet that detects resource VISA for a device 6552 name, but I can't seem to figure out how to get the name of MAX the device resource.   Both the niHsdio and the properties of 'name of the resource' OR DcPS requires that you spend a session valid in them need valid resource name andI to make...

    And no, asking the operator to launch of MAX and find the name of the resource is not an option

    Thank you

    Hello

    Modular instruments and devices devices use their own set of screws to find devices in the system. The lybrary called NOR-ModInst and i's includedin the palette of the utility with the MID drivers.

    Here is a small example that demonstrates the use of their base.

    Let me know there are questions of the amy

    Kind regards

    JC

  • How to display the parameter string registered by DBMS_XMLINDEX?

    This is probably a stupid question, but I can't seem to find any function to display the setting of a parameter string that was recorded by DBMX_XMLINDEX. REGISTERPARAMETER.

    For example,.

    If I have:
    BEGIN
    DBMX_XMLINDEX.REGISTERPARAMETER('indexParam', 'xxxxxxxx');
    END;
    /
    How to display the value of 'indexParam' after creation?
    SQL> set long 1000
    SQL>
    SQL> select paramstr
      2  from xdb.xdb$xidx_param_t
      3  where param_name = 'MYINDEXPARAM'
      4  ;
    
    PARAMSTR
    --------------------------------------------------------------------------------
    PATH TABLE po_ptab
        PATH ID INDEX po_pidx
        ORDER KEY INDEX po_oidx
        VALUE INDEX po_vidx
        PATHS(NAMESPACE MAPPING(xmlns:p="http://www.example.com/IPO"))
        GROUP MASTERGROUP XMLTABLE PO_TAB
        ('/p:PurchaseOrder'
            COLUMNS
               REFERENCE VARCHAR2(30) PATH 'p:Reference',
               REQUESTOR VARCHAR2(30) PATH 'p:Requestor' )
        GROUP ITEMGROUP XMLTABLE ITEMGROUP_TAB
        ('/p:PurchaseOrder/p:LineItems/p:LineItem'
            COLUMNS
               LINENUMBER NUMBER(38) PATH '@p:ItemNumber',
               QUANTITY NUMBER(38) PATH '@p:Quantity',
               DESCRIPTION VARCHAR2(256) PATH 'p:Description')
     
    

    After you add it to an index, you can also view the content in USER_XML_INDEXES. PARAMETERS (XML format).

  • Satellite P30: How to format the HARD drive and install a new OS?

    I have a satellite P30 laptop with Windows XP. I plug myself a new OS (namely because I can't find my old recovery CD CD and OS) that I want to do a re-shape full of my system. Reason is that my system has been painfully slower and slower over the last year. I even updated my RAM to 512 MB standard supplied with the machine to 2 GB, but it seems to have had little or no effect. So my questions are:-

    1] where can I get my hands on the restore CD that has all the drivers on this subject, and any recovery CD to reformat my HARD drive?
    [2] in the order in which I will make this reformatting?
    How can [3] after having bought an external HARD drive to keep files that I don't want to lose, I transfer those of before my re - format?

    Any help will be greatly appreciated

    :-)

    Hello

    You received with the laptop Toshiba Recovery CD! Am I wrong?
    So what s the problem?

    Simply insert the CD and try to boot from this CD.
    The restore CD contains all Toshiba drivers, tools and utilities Windows OS + additional software like Win DVD for example.
    The installation will set the laptop to factory settings, but will also format the HARD drive!

    Up to now, we come to the point 3; --> How do I save the data
    If you have purchased a second HDD and connect it to the USB port and transfer all the necessary files on the second HDD
    If you have purchased only the HARD drive, then you will need a USB HDD 2.5 case.

    Best regards

  • How to format the HDD on my Satellite C855 1GQ

    I have a Toshiba Satellite C855 1GQ.
    How to format my HARD drive for your help thanks.

    Hello

    I don't know what you want to do exactly. HARD disk can be formatted before installing original recovery image that you got with your machine but also if you want to install the version of the OS.

    If you created the recovery disc you can format the HARD drive by using one of the available options (erase the hard drive) - http://aps2.toshiba-tro.de/kb0/HTD1303440001R02.htm
    In the case you want to use the installation of Microsoft at the beginning of the installation disc disc HARD current will be shown. You have the option to delete existing partitions, create new partitions and install the Windows operating system.

    Please let us know what you want to do exactly.

  • How to format the disk with Windows Vista to install Windows XP

    Hi, I would like to format my laptop and put Windows XP, but when I tried to start using the XP cd does not recognize the HARD drive, the type of my HARD disk is SATA
    I think that I need to download specific drivers, but I found no drivers on the toshiba Web page
    Thank you

    Hi Bertoni

    Sorry, but I must be honest now: I am ready to help, but I hate it when someone write about problems, but not write a which model of laptop. How to check the download page and you give any information when nobody knows what model of laptop you have?

    Let us know what model of laptop you have and we can continue the discussion. Otherwise visit category where your laptop and I am 100% sure that you will find the right answer it?

  • M55-S325: how to format the laptop?

    How can I reformat my laptop which is a M55-S325, and what I have to do this.

    Hello David

    The question is what you want to install on your laptop?
    Image recovery or maybe Microsoft Windows XP edition full home version?

    If you use the recovery that will be formatted the HARD drive before Setup starts and with the installation of Microsoft there is an option that format any partition or HARD drive.

    Good bye

  • How to format the drive "C"?

    How to format my 'C' drive which is clear of all my files and programs? I want to sell my computer but don't want anything of mine on the disc.

    Hello

    You format the drive as part of the resettlement process.

    Do a clean reinstall of the operating system of your computer to the factory settings; State new, as it was purchased.

    But remember that nothing is definitively deleted; only the 'flag' to where the files are located is removed.

    It is a good program to use to wipe the hard drive of most of the attempts to access your information 'deleted '.

    http://www.DBAN.org/

    Then install the own.

    You can contact your computer manufacturer and ask them to send you a set of recovery disks.

    They should do this for a small fee.

    And if you have never received a recovery disk when you bought your computer, there should be a recovery on the drive Partition hard reinstall Windows how much you bought your computer.

    The recovery process can be started by pressing a particular combination of the key or keys at startup. (Power on / start)

    Maybe it's F10, F11, Alt + F10, etc., depending on the manufacturer.

    Ask them to the proper key sequence.

    See you soon.

Maybe you are looking for