Part of labelfield Focus

Hi all

I have a labelfield with the text of the "he is an example of a text on which you can access this html page by clicking on www.google.com and send me an email [email protected] please click on this."

I would ony www.google.com and [email protected] to focus and navigate to browserfield or email respectively.

Anyone tried and if so can you let me know how you did it.

If there is a code, it would be a great help.

Thanks in advance.

In the hope of sone of you hear.

Krishnan.

Thank you Simon and Govind.

And sorry for this late reply.

Simon I tried your method, but I was not able to highlight the required text.

I tried your approach, it wasn't properly kaleidoscope of Govind for example when text on the second label has become huge it allows to move immediately to the bottom and he was pulling to the right.

Finally, I decided to go with a static web page with two links that solved my problem and works fine.

But really thanks for sharing these detials.

And if you find a way to solve via a richtextfield or a labelfield, please let me know.

Concerning

Krishnan.

Tags: BlackBerry Developers

Similar Questions

  • How to focus LabelField programmable aid?

    Hi guys.

    I'm trying LabelField programmable way to use the accent.

    My share of coding:

    LabelField lbl = new LabelField("Text", LabelField.FOCUSABLE);
    mainScreen.add(lbl);
    lbl.setFosus();
    

    But this code does not work.

    When push the screen, this field is not well centered. Instead of him, first field focus concentrates.

    What I am doing wrong?

    Thanks in advance.

    crush onDisplay and focus the field here. You may need to use invokelater (for delay)

  • Focus with GridFieldManager problem

    I'm having a problem of development/unfocus.  A label should draw a border of red around him when it gets the focus and a black border when he loses it.  But when I add/remove a label for a GridFieldManager (see below the code and the screenshot), I find that the update will temporarily to the field at (0,0) and 'loses' never the focus - in other words, he draws a red border, but never black.  So, I end up having 2 fields with the red border - something that should never happen!

    I'm under 5.0 SDK on Eclipse.  I reproduced the problem in the simplest possible form: If you import the following code, you'll see for yourself.  Please help me!

    Import net.rim.device.api.ui.XYEdges;
    Import net.rim.device.api.ui.component.LabelField;
    Import net.rim.device.api.ui.container.GridFieldManager;
    Import net.rim.device.api.ui.container.MainScreen;
    Import net.rim.device.api.ui.decor.Border;
    Import net.rim.device.api.ui.decor.BorderFactory;

    / public final class screen extends MyScreen
    {
    private GridFieldManager MDT;
       
    public MyScreen()
    {
    Set the displayed title of the screen
    setTitle ("MyTitle");
    int size = 3;
    GFM = new GridFieldManager (size, size, GridFieldManager.FIELD_HCENTER |) GridFieldManager.FOCUSABLE);
    for (int y = 0; y)< size;="" y++)="">
    for (int x = 0; x)< size;="" x++)="">
    LabelField nf = new LabelField ("H", LabelField.FOCUSABLE) {}
    protected boolean navigationClick (int time, int status) {}
    swap (this);
    this.setFocus ();
    Returns true;
    }

    Protected Sub onFocus (int direction) {}
    this.setBorder (BorderFactory.createSimpleBorder (new XYEdges (1,1,1,1), new XYEdges(0xFF0000,0xFF0000,0xFF0000,0xFF0000), Border.STYLE_DASHED));
    }
                       
    protected void onUnfocus () {}
    this.setBorder (BorderFactory.createSimpleBorder (XYEdges (1,1,1,1))) of new;
    }

    };
    nf.setBorder (BorderFactory.createSimpleBorder (XYEdges (1,1,1,1))) of new;
                   
    GFM. Add (NF);
    }
    }
    Add (GFM);
    }
       
    private void swap (LabelField lf) {}
    GFM. Delete (LF);
    GFM. Add (LF);
    }
    }

    Thus, even if I clicked on the intermediate element, an area of development is established around the item to (0,0)

    Why is this?

    Sorry to get to this post, this late - I could have saved a lot of traffic if I noticed it earlier...

    In any case - onUnfocus has a very strange behavior. In some cases (I don't know which) it is not called at all when the field loses focus. So, rather than using onFocus/onUnfocus pair, use FocusChangeListener. This listener will turn on the eventType and onFocus on FOCUS_GAINED work and the work of onUnfocus on FOCUS_LOST.

    Overall, it will look like this:

    import net.rim.device.api.ui.XYEdges;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.container.GridFieldManager;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.decor.Border;
    import net.rim.device.api.ui.decor.BorderFactory;
    
    public final class MyScreen extends MainScreen
    {
        private GridFieldManager gfm;
    
        public MyScreen()
        {
            // Set the displayed title of the screen
            setTitle("MyTitle");
            int size = 3;
            FocusChangeListener fcl = new FocusChangeListener() {
              public void focusChanged(Field field, int eventType) {
                switch (eventType) {
                case FOCUS_GAINED:
                  field.setBorder(BorderFactory.createSimpleBorder(new XYEdges(1,1,1,1), new XYEdges(0xFF0000,0xFF0000,0xFF0000,0xFF0000), Border.STYLE_DASHED), false);
                  break;
                case FOCUS_LOST:
                  field.setBorder(BorderFactory.createSimpleBorder(new XYEdges(1,1,1,1)), false);
                  break;
                case FOCUS_CHANGED:
                  break;
                default:
                  break;
                }
              }
            };
            gfm = new GridFieldManager(size,size,GridFieldManager.FIELD_HCENTER|GridFieldManager.FOCUSABLE);
            for (int y = 0; y < size; y++) {
                for (int x = 0; x < size; x++) {
                    LabelField nf = new LabelField("H", LabelField.FOCUSABLE) {
                        protected boolean navigationClick(int time, int status) {
                            swap(this) ;
                            this.setFocus();
                            return true;
                        }
    
                    };
                    nf.setBorder(BorderFactory.createSimpleBorder(new XYEdges(1,1,1,1)));
                    nf.setFocusListener(fcl);
    
                    gfm.add(nf);
                }
            }
            add(gfm);
        }
    
        private void swap(LabelField lf){
            gfm.delete(lf);
            gfm.add(lf);
        }
    }
    

    You will notice that I have created a FocusChangeListener to listen each LabelField and changed calls setBorder on focus has changed not update in page layout (as does not change the size of the border), which will make it much more effective and does not cause the entire screen redraw

    You can do even better if you setBorder on the ground as it is created, but use the long form - viewable one following first parameter. Define borders forVISUAL_STATE_FOCU andVISUAL_STATE_NORMA at least. Again, take a long look at prototypes withupdateLayou indicator. This way you won't have to worry about changes in development at all - the system will do it for you

  • How to make a labelfield right aligned text

    I want to make my label text aligned to right field in then the screen

    LabelField content = new LabelField(description,LabelField.FOCUSABLE|USE_ALL_WIDTH|FIELD_RIGHT)
    

    This labelfield, I add to an optimization of internal resources

    VerticalFieldManager vfm = new VerticalFieldManager (
                    VerticalFieldManager .VERTICAL_SCROLL
                            | VerticalFieldManager .FOCUSABLE) {
                protected void sublayout(int width, int height) {
    
                    super.sublayout(Display.getWidth() - 20, height);
                    setExtent(Display.getWidth() - 20, 33);
                }
            };
    

    This optimization of internal resources, I add to main vfm called external resources management and in defining its position

    layoutChild(vfm, maxWidth, maxHeight);
                        setPositionChild(vfm,290, 123);
    

    My screen is 320 x 240

    But the text goes out of the screen. Help, please

    Forget all the positioning in the Manager and try this:

    Content LabelField = new LabelField (description, LabelField.FOCUSABLE |) DRAWSTYLE. (RIGHT);

    Announcing this to a VerticalFieldManager or directly to your screen and I think this should work for you.

    If this is not the case, let know us and we can look at the positioning of the field.

    As a side note, it seems doubtful:

    protected void sublayout (int width, int height) {}
    Super.sublayout (Display.GetWidth () - 20, height);
    setExtent (Display.getWidth () - 20: 33);
    }

    What you trying to do?  Why is the 33 important?

  • labelField unfocus background color

    I add a few labelField focusable on color management, when compiling with jre 4.7 or later version, it is ok, but with 4.5 labelFields background get white color when they are unfocuses.

    From memory, there was a change made to LabelField approximately 4.6, so that he could extend over several lines, in which up to 4.5, you may lose this as well.  We could with the labelField autour mud so that it can work in both places, but I would swap that Exchange you using a RichTextField who is not active, since it provides little nearly the same features.

  • LabelField Scrollable

    I have to show some information. If the information is more than one line, it will be automatically breaks into several lines. To do this, I created my own CustomLabelField. It works very well. But when I add several CustomLabelFields in a VerticalFieldManager of the labels underneath the screen, so I want to scroll to see these labels, I can't scroll. So I write this method:

        public boolean isFocusable()
        {
            return isFocusable;
        }
    

    By doing this I can scroll. But this time, when a label is focused on the background are changes its color. I don't want to. I wan't color will stay the same and I can scroll. What is the best way to do it?

    Thank you.

    You realize that you can do a labelField focus using its constructor, for example:

    My lab LabelField = new LabelField ("Test", LabelField.FOCUSABLE);

    The only way I can think of (and I'm not an expert in the user interface, so there are likely to be other ways), is to replace the getFocusRect() and return as a rectanlge 0,0,0,0.  I tried this in 4.2.1 seemed to work.  But might not work for you, and I have no idea of the consequences.

            public void getFocusRect(XYRect rect) {
                // super.getFocusRect(rect);
                rect.width = 0;
                rect.height = 0;
            }
    

    Just another thought, have you tried a RichTextField in place and place your LabelField?

  • Moving/next focus

    Hello

    I am trying to create a context menu that is customized in the screen.

    To do this, I have 3 classes:

    CustomVFM-> extends VerticalFieldManager

    FileMenuScreen-> extends CustomPopupScreen

    CustomPopupScreen-> extends to screen

    I create a CustomVFM

    for example

    VFM CustomVFM = new CustomVFM (Manager.USE_ALL_WIDTH);
    vfm.addLabelField (new LabelField ("Download...", LabelField.FOCUSABLE |)) LabelField.HIGHLIGHT_SELECT));
    vfm.addSeperatorField (new SeparatorField());
    vfm.addLabelField (new LabelField ("Communication Options...", LabelField.FOCUSABLE |)) LabelField.HIGHLIGHT_SELECT));
    vfm.addLabelField (new LabelField ("Download Options...", LabelField.FOCUSABLE |)) LabelField.HIGHLIGHT_SELECT));
    vfm.addLabelField (new LabelField ("Credentials of change...", LabelField.FOCUSABLE |)) LabelField.HIGHLIGHT_SELECT));

    I then created a "myFMS = FileMenuSrceen (vfm)", and then pass the CustomVFM.

    The constructor is

    FileMenuScreen (CustomVFM)

    {

    Super (VFM)

    ...

    }

    CustomPopupScreen (VOR CustomVFM)

    {

    Super (new VerticalFieldManager(VERTICAL_SCROLL |) VERTICAL_SCROLLBAR));

    Add (VFM);

    }

    This creates the screen as I want.

    I want to replace navigationMovement in myFMS to move the focus to the next item up and down.

    How can I do this?

    When I call getFieldCount)

    It returns 1?

    Although I haveadded 5 fields as in the example above?

    I tried nextFocus() but it does not work.

    I would be grateful for any help!

    See you soon,.

    Bob.

    Do not take into account,

    Found by using the solution:

    setFocus (x, y, status, time field);

  • How to avoid the blue color of a LabelField default selection?

    Hello

    Below, I have given my code please review and let me know where I did wrong. because my requirment must show the labelfield with a specific color. not work but useless default blue color is coming with the text. I want to avoid that the color blue.

    final String dimensionally = 'Test ';
    LabelField lbl = new LabelField (slable, 0, slable.length (), LabelField.FOCUSABLE |) LabelField.HIGHLIGHT_FOCUS) {}
                            
    Do police = Font.getDefault (.derive(Font.UNDERLINED |)) Font.PLAIN, 12);
    int x = font.getAdvance (slable);
    int y = font.getHeight ();
    Boolean hasFocus;
    protected void paint (Graphics g) {}
    g.setColor (Color.BLUE);
    g.setFont (do);
    {if (HasFocus)}
    g.setColor (Utility.ACTIS_MAAROON_COLOR);
    g.fillRoundRect (0, 0, x, y, 10, 10);
    g.setColor (Color.WHITE);
    g.drawText (dimensionally, 0, 0);
    } else {}
    g.setColor (Color.BLUE);
    g.drawText (dimensionally, 0, 0);
    }
    Invalidate();
    Super.Paint (g);
    }
                           
    protected boolean trackwheelClick (int arg0, int arg1) {}
    //

    }

    protected void onFocus (int arg0) {}
    hasFocus = true;
    super.onFocus (arg0);
    }

    protected void onUnfocus() {}
    hasFocus = false;
    super.onUnfocus ();
    }

    public void select (boolean arg0) throws IllegalStateException {}
    Super.Select (false);
    }
    /*
    Protected Sub layout (int width, int height) {}
    width = x;
    height = y;
    Super.Layout (width, height);
    super.setExtent (width, height);
    }
    */
                           
    };

    and one last thing is that when I method of positioning cover font size is bigger.

    Please answer...

    drawHighlightRegion is used to paint the selection, see also drawFocus.

  • Selection of LabelField

    OK, im having a little difficulty implementing an idea and tried to teach me, but after a few hours I think im going to ask for help. Laughing out loud.

    I am wanting a series of LabelFields once selected screen and 'Enter' or trackball is pressed, taking me in a new window. So basically, it would look like this:

    ___________________________

    -Associate label

    -The two link label

    -Connect the three labels

    -Bind four Label

    ___________________________

    I know this has something to do with KeyPadListener and pushScreen() but anyway I tried to write has resulted in an error. Quite simply, I don't know how to write such keypadlistener when the button ' link a Label ' is focuesed and enter or click on the trackball it gives pushScreen (blah).

    I was a noob right and read every post on the unique on KeyPadListener and also past forum to review the Java library.

    1. ensure that all labels are created by using LabelField.FOCUSABLE

    Something like.

    LabelField label1 = new LabelField("Label 1 Text", LabelField.FOCUSABLE);
    

    2. your screen should substitute navigationalClick or navigationalUnclick (up to you depending on you want to invoke on down/up event).

    Something like...

            protected boolean navigationUnclick(int status, int time)        {            Field field = getLeafFieldWithFocus();            if ( field == label1 )            {                System.out.println("Label 1 clicked!");                return true;             }            else if ( field == label2 )            {                System.out.println("Label 2 clicked");                return true;             }            return super.navigationalUnclick(status, time);         }
    

    Note:

    4.7.0 uses touch screen that uses a different API. touchEvent() of your interest

    older devices that uses the wheel event IE replace trackWheelClick (State of the int, int time)

    Hope that helps.

  • How to put text on the image of blackberry?

    I'm a Blackberry app. In my application I need to show show text in an image. So I used this code.

    tab1 = new LabelField ("Page 1", LabelField.FOCUSABLE |) LabelField.HIGHLIGHT_SELECT) {}

    protected void paintBackground (Graphics g) {}
    TODO self-generating method stub
    super.paintBackground (g);
    EncodedImage tmpimg = EncodedImage.getEncodedImageResource ("ic_menu_refresh.png");
    try {}
    g.drawImage (0, 0, 70, 40, tmpimg, 0, 0, 0);

    }
    {} catch (IllegalArgumentException iae)
    System.out.println ("bad arguments.");
    }
    }

    Protected Sub layout (int width, int height) {}
    Super.Layout (width, height);
    setExtent (70, 40);
    };

    Protected Sub paint (figure net.rim.device.api.ui.Graphics) {}
    graphics.setColor (Color.WHITE);
    Super.Paint (Graphics);
    };

    };

    This code text giving on image but I want that this text not on the center of the image. I want it on the bottom of the image. I also want to resize the image depends on the size of labelfield... Please help me friends...

    I'm curious to know why you want to avoid having a VerticalFieldManager? It's a standard way of BlackBerry to arrange fields and managers vertically. He respects the flags of horizontal alignment (FIELD_LEFT, FIELD_HCENTER and FIELD_RIGHT) for "children" and does not take into account all verticals (naturally!).

    It also respects the margins of fields, which is a huge advantage - you just put properly and let the BlackBerry primitives to take care of the presentation of the screen for you. Don't try to reinvent the wheel - channel your time and energy into the functional parts of your application.

  • Dial a number in a label field

    Hello

    I am currently developing an app for my blackberry. I have a labelfield:

    myLabelField6 = new LabelField("01226 211 211", LabelField.FOCUSABLE);
    

    which displays a phone number. Could you help me please by allowing this phone number be clicked on and then call the number?

    Any help on that would be great

    Thank you

    Ash

    as the method is part of the labelfield class, you can use its methods, simply call getText to retrieve the text.

  • Phone added to random my and other contacts of newsgroup?

    My phone randomly added my number and a few other contacts in a discussion group I was recently removed? I wasn't even in iMessage, when this happened.

    Is there a question here?

    If I had to, I would hazard a guess that you wonder how/why your phone you added to a discussion group? The answer is simple - he can't, and he didn't. If you are not part of a focus group and then there is no way that your phone still knows the existence of the cat, and no way, he can join arbitrarily.

    On the other hand, if someone else in the conversation adds you on chat, well, it's a completely different question. I suggest you talk to other people on the chat to know that you have added and why.

  • Satellite L350 - 12 c: can I put mothers?

    Hi all,.

    If possible, I try to upgrade my laptop a little.
    So I am looking for a motherboard that fits into this L350 - 12 c and supports at least a best graphic chipset...

    So ist here anyone out there who knews mothers out of the L350 series wich will fit in this body?
    Of course--not AMD those... I just put a processor t9300 inside...

    Best regards

    Karsten

    Upgrade of the motherboard. What say about it? I think that you are the first person with this idea. For the most part, people are focused on certain hardware components.

    Toshiba offers 6 different models of L350 with different hardware and different ports. This means that each of them do not take the cover of your laptop computer plastic due to lack of ports or certain mainboard has some ports which are not available on your laptop, so this kind of upgrade is not so easy.

    Theoretically you should find out who from this 6 platforms has a form identical but better material and the exchange of eventyally it.
    When you do this you can not use more original install recovery disc. And the big question is: where?

    All this is is not so easy in my opinion you should not waste your time and your energy for her. If you are not satisfied with the performance of your laptop and you want to have the most powerful machine to sell and buy the other. Believe me this is the best thing you can do.

  • Cannot install Quicktime for Windows XP - "network resource is unavailable.

    OK, here are a few basic rules on this issue:

    1. I use Quicktime.msi version 7.72.80.56 on a Windows XP system.

    2 Quicktime MUST be installed from a batch file.  Do not ask why or try to tell me how to do that or tell me there is more easy or better ways to do it.  If you can't help with an command line to the batch file install only, please do not respond.

    3. it is a new PERFECTLY any new installation of Windows XP.  There is NOTHING else on this system.  There has been NO other program of ANY SORT (not Quicktime, not ITunes, not any program from any provider never) installed before on this OS at all.  This operating system has already been used for any purpose.  There was not a single open web page, not only one other task run manually after the installation.  These are all FACTS that are not open to speculation or discussion.  If you want to try to tell me that something is corrupt in my operating system or that there is another program interfering, or that I have a virus, don't answer please.

    4 ONLY Quicktime must be installed.  Period.  If you want tell me trying to install ITunes, or a 3rd party, program, please do not respond.

    Sorry to be a jerk to this topic but I've lost all patience with people who try to tell me that I don't want what I said I mean really or I want something different than what I said that I wanted.  I don't want really really exactly what I'm saying I want.  Trying to prove that you know more that I am offering opinions as to why I should use some program 3rd party or saying that I would not install from a batch file does nothing more to irritate me and lost time that all parties concerned should focus on more useful efforts.

    Now to the questions:

    I try to install Quicktime via a batch file.  I have extracted the QuickTime.msi, AppleSoftwareUpdate.msi, and AppleApplicationSupport.msi (from QuickTimeInstaller.exe with switch/extract) in the C:\Windows folder.  My batch file is also located there.  Here's what I have in the batch file (only functional lines, other unrelated stuff has been removed):

    @echo installation QuickTime.msi (1/3)

    msiexec /i "C:\Windows\QuickTime.msi" / passive DESKTOP_SHORTCUTS = No. SCHEDULE_ASUW = 0 ASUWINSTALLED = 0

    @echo 1/3 installed!

    @echo installation QuickTime.msi (2/3)

    msiexec /i "C:\Windows\AppleSoftwareUpdate.msi" / passive

    @echo 2/3 installed!

    @echo installation QuickTime.msi (3/3)

    msiexec /i "C:\Windows\AppleApplicationSupport.msi" / passive

    @echo 3/3 installed!

    del %SystemRoot%\Tasks\AppleSoftwareUpdate.job

    This operation fails with no feedback at all.

    Then I tried to type manually in the following:

    msiexec /i "C:\Windows\QuickTime.msi".

    This translates into a window telling me that it can't find QuickTime.msi and it is looking for the following: c:\docume~1\benchm~1\locals~1\temp\ixp927.tmp.  There no record on the system named point mark, or anything similarly similar to this name.  This is an invalid path and name of the file on this computer.

    If I press the Browse button and point to the correct location for QuickTime.msi (C:\Windows), it will work correctly, but is not an option.  It must run unattended and automatically since the batch file.

    Is there a switch (or any other means without assistance) to indicate to the program that QuickTime.msi is located in C:\Windows?  I also tried:

    msiexec /i "% ~ dp0QuickTime.msi" and it also fails.

    The extracted .msi files are not corrupt, they will install if I run them manually, but still, this is not an option.

    Hello

    Thank you for visiting the Microsoft answers community site. The question you posted would be better suited in the Microsoft Developer Network community.

    Please visit the link below to find a community that will provide the support you want.

    http://social.msdn.Microsoft.com/forums/da-DK/categories

  • The highlighing for a field color can be customized

    Please let me know if we can change the highlight color for a label to a color we want it is to tell when any field label is highlighted by default the labelfield highlighted turns dark blue as shown below:

    This dark blue color can be changed at the light blue or green, or any other custom color. Please help me on this matter as soon as possible. If necessary provide all code snippet as I am new blackberry development.

    Below is some code that should go you.  Note that this code is untested.  It has been cut and paste of the labour code, but I edited to get rid of redundant things / have fun.

    LabelField lb  = new LabelField("Label",  LabelField.FOCUSABLE ) {
        boolean _inFocus = false;
        public void onFocus(int direction) {
            _inFocus = true;
            super.onFocus(direction);
            this.invalidate();
        }
        public void onUnfocus() {
            _inFocus = false;
            super.onUnfocus();
            this.invalidate();
        }
        public void paint(Graphics g) {
            if ( _inFocus ) {
                g.setBackgroundColor( 0x0000FF00 );
            } else {
                g.setBackgroundColor( 0x00FF0000 );
            }
            g.clear();
            super.paint(g);
        }
    };
    

    Just noticed there is an interesting variation on this code in this post:

    http://supportforums.BlackBerry.com/T5/Java-development/focus-issue/TD-p/374304

Maybe you are looking for