Make a label clickable e-mail?

I saw a post about this somewhere and I will probably start, but for the life of me I can't find the post, or remember how to do this.

Basically, I want to make a LabelField that contains a web URL or email, clickable.  Someone tell me something?

You can override some methods of a label field, but I prefer to use this: href field

import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.FontFamily;
import net.rim.device.api.ui.Graphics;

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 maskColour = 0xBBBBBB;

public HrefField(String content) {
super(Field.FOCUSABLE);
this.content = content;
fieldFont = defaultFont();
fieldWidth = fieldFont.getAdvance(content)+2;
fieldHeight = fieldFont.getHeight() + 3;
}

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);
}

protected boolean navigationClick(int status, int time) {
fieldChangeNotify(1);
return true;
}

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

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

public static Font defaultFont() {
try {
FontFamily theFam = FontFamily.forName("SYSTEM");
return theFam.getFont(net.rim.device.api.ui.Font.PLAIN, 14);
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
}
return null;
}
}

Tags: BlackBerry Developers

Similar Questions

  • the ability to make smaller pictures when e-mailing is no longer appears. Anyone have this problem?

    the ability to make smaller pictures when e-mailing is no longer appears. Anyone have this problem?

    For Windows XP, try the following steps:

    Go to start / run... and type or copy / paste the following command:

    regsvr32 /i shimgvw.dll

    (Yes, the space after the 2 and space after that the i is necessary)

    Press on... Come in...

    You should see a dialog box stating:
    DllRegisterServer and DllInstall in successful shimgvw.dll

  • Link clickable e-mail to website button

    How can I link button clickable e-mail for url address, that can be incorporated to send an email message?

    Best regards

    Tuija

    to use the user's default e-mail client, you can use navigatetourl:

    var object: String = "whatever;"

    var body: String = "whatever;"

    E-mail: string var = 'whatever '.

    var urlrequest:URLRequest = new URLRequest ("mailto:"+email+"?subject="+subject+"&body=" + body);

    navigateToURL (urlrequest, "_blank");

  • How I can do to make an image "clickable"?

    Hello, sorry but my English is so bad.

    I want to know how to make an image "clickable", but of the possibility to link the image to a archive external, because when you preview the web and you click the image, it opens a new window with the image. So if you know a widget or something to do this please tell me!

    Thank you

    I found it, with the light box, you can click on the thumbnail and it opens a larger image in the same window

  • How can I make a label of wine bottle nonrectangular in 3D in Photoshop CS6?

    I got pretty proficient with Photoshop CS6 3D tools, but the mesh of the integrated wine bottle gives me a headache.

    I would like to make the label of a bottle of wine, some other rectangular. But when I use an opacity card to control the shape of the label (to make circular, for example), the bottle becomes as transparent. I have not found a way to make the transparent label areas while leaving the glass not affected. I tried black on the card as well as the transparent opacity (WARNING: no pixels). Whatever it is, the glass also disappears. In fact, if I'm trying to keep it smaller than its original size and same label rectangular - using black, transparent, or even cropping of the opacity for a smaller size card, it always affect the same area of the bottle glass (see picture). Glass is 100% opaque and has No card opacity.)


    This could be a bug CS6?

    Thanks in advance for any help.

    Darrell

    -------------------------------------

    wine_label.jpg


    I think that I thought about it.

    1. With your material label layer selected, go to the properties panel. Under opacity, select 'New Texture'. Make the size of the file of the same size as your material of the main tag that surrounds the whole bottle.
    2. Create a black mask / white standard, the white area being your irregular shape.
    3. Save on the .psb. You should see only the areas you want to be opaque have now been hidden.

    I would also add that you must set the color of "Diffuse" your label to the same as the material of your bottle, as well as the correspondence the other properties (refraction, specular, etc.) so that the 'glass' corresponds to...

    Hope that helps!

  • How to make a label (javafx) to display the current time dynamically?

    Hi all

    How to make a label (javafx) to display the current time dynamically?

    I have not found a Type of event related to the time in javafx API.

    Please give me some suggestions. Thank you!

    Sage

    There are lots of examples of JavaFX clocks available, for example https://gist.github.com/jewelsea/3388637 or http://blog.crisp.se/2012/08/09/perlundholm/an-analog-clock-in-javafx

    For a simple label displaying the time, the simplest thing is to create a Timeline with duration 1 second and the number of indefinite cycle, which triggers an event handler that updates the label:

    final Label clock = new Label();
    final DateFormat format = DateFormat.getInstance();
    final Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(1), new EventHandler() {
         @Override
         public void handle(ActionEvent event) {
              final Calendar cal = Calendar.getInstance();
              clock.setText(format.format(cal.getTime());
         }
    });
    timeline.setCycleCount(Animation.INDEFINITE);
    timeline.play();
    

    (If you use Java 8, use the new time API, which is much more pleasant than calendar.)

  • How to make a label

    I need to make a label which is 2,062 inches in diameter. I want to add a small image for this and the text. All attempts for several days has failed. Is there a tutorial that would help or how can I do this?

    The cropping of a photo in a small circle, here are two former subjects of the forum:

    http://forums.Adobe.com/message/3155570

    http://forums.Adobe.com/message/2488171

  • How can I make the label to go on top of the text box?

    How can I make the label to go on top of the text box?

    Thanks again,
    Doug

    Set the label of the horizontal / Vertical alignment for the textarea to the aboveproperty.

  • Unable to create a web page that is clickable e-mail link

    Whenever I want to send a link in an email from a web page I visit, it is not clickable.

    Make sure you use a version of the rich text editor or email program you are using allows hyperlinks to be sent into the body without additional measures.  Some programs require that you highlight the text, right click and select Insert Hyperlink.  Then you could paste the URL and it was going to turn into a clickable link.

    What do you use to send e-mails?  What program or online interface?

  • link to clickable e-mail in the apex report

    Hello

    I have the emails of information to store in a table and would like to make this clickable email.
    Is this possible? How?

    I've been able to do in forms, but don't know how it might be made on the classic interactive reports.

    Thank you very much for your help!
    LC

    You can change your column attributes in your interactive report.

    Set your text link "Email User" or what you want... If you want the text to be the email address then it would #COLUMN_NAME # (substitute COLUMN_NAME column name that contains the e-mail address.
    In the column link section set your target URL
    In the URL field, you can set it to mailto:#COLUMN_NAME#

    I hope this helps.

  • Vista Windows Movie maker clip sent by e-mail, but cannot be opened by recipient of Vista: how to fix?

    1. how to ensure a video clip is visible on the compatible PC?
    2. how to convert a movie file type to be viewed on a Mac?

    Hello
     
    Please answer the following questions so that we can better help you.
    1. what e-mail program you are using to view the clip?
    2 what is Windows Mail or Internet Explorer?
    3. that you get an error message when tried to open the clip?
    4. is the item sent by a user by electronic mail is running Vista or any other operating system?
     
    First, download the clip, save it to the desktop and try to open it using Windows Movie Maker.
     
    "Thanks to jakeludington for providing the following valuable information."
     
    How to convert Windows Movie Maker files in a Mac compatible file?
    Windows Movie Maker files are the format of Windows Movie Maker project. The files say things to Windows Movie Maker on your video editing project like video clips are used, which audio files you have imported, go to what transitions between clips, and whose effects are used. These files are essentially readable only in Windows Movie Maker and certainly doesn't work on a Mac. Two options to save a video file in Movie Maker are DV - AVI or WMV. To create a Mac compatible video file, open the file in Windows Movie Maker in Windows Movie Maker, save the movie to the highest quality WMV or preferably as a DV - AVI file format. Import the AVI or WMV file ended up in iMovie or another Mac video editing application.
     
    To convert Windows Movie Maker files in Mac format, please post your request here: http://discussions.apple.com/index.jspa
     
    I hope this helps.
     
    Kind regards
    Syed V
    Answers from Microsoft supports the engineer.

  • Math function round() makes invisible label...

    I have a ranking application that figures on a percentage of an assignment and displays a side.

    with gold update, the label no longer appears when I run the application.

    Label {
                    id: findGrade
                    // custom property to calculate final grade percentage
                    text: "Percent: " + round(grdCalc.text * 100) / 100 + "%"
                    textStyle.fontWeight: FontWeight.Bold
                    enabled: true
                    visible: true
    
                }
    

    I also tried of Math.round, but it doesn't seem to work. I need to import a library of bb to make this work?

    If so, how can I find out what libraries can I include in a project. is it all just

    import bb.math 1.0?

    It must be Math.round (). I have not tried your code and can not at the present time, but try to put parentheses around all the math... "Percent:" + (Math.round(grdCalc.text * 100) / 100) + "%" ""

    Also conceivable that you'll have to do something with grdCalc.text. parseInt (grdCalc.text) or parseFloat(). Actually, I forgot how JavaScript will handle this entry otherwise.

  • How to make juno my default E-mail program

    How do Juno my default e-mail program. Windows 7

    You can not make more default programs like Juno Webmail. You may be able to get some of the options usually found only with the customers of e-mail by default with this supplement.

  • Microsoft account check your email to complete the setting of the Microsoft account, just to make sure that this e-mail address is your

    Microsoft account

    Please check your email address

    To complete the setting of the Microsoft account, we just need to make sure that this email address is yours.

    Check xxxxxxxxxx@xxxxxxx,xxx

    If you did not make this request, click here to cancel.

    Thank you

    The team Microsoft account

    I do not have a Microsoft Email account!  My wife did and when I click on the button check it evokes its address!

    I just bought a new Dell with Windows 8 and recorded with my separate email address and they send it to my e-mail address for confirmation and it evokes e-mail address of my wife in the cross reference by address or telephone numbers.

    It is very painful and would like to know what are my options to return to Windows 7

    Hi Patricia,

    Please follow the instructions below:

    How to check an e-mail address in your Microsoft account

    When you use a different e-mail to your Microsoft account, you get a link in an e-mail. Follow the link in that email to verify the address e-mail. If you need a new verification email:
    1. Connect to the Manage aliases for your account page.
    2. Click on validate next to your email address and then click on email.

    If you want to go for verification by phone, you must type the code that appears on the verification page. As soon as you type the phone number and click on "send code", the next page will ask you this code.

    Hope this information was useful.

  • How can I get a DELIVERY of RETURN UPS LABEL via e-mail?

    label received

    Hello!  First off because the risk of privacy you want to edit and delete your order number and CRA mailed.  Second, have you checked your SPAM etc folders. ?  If there is still nothing you can message private your numbers of the CRA and the order to Dell-Lorna and see if she can figure out where he went.

Maybe you are looking for