Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 829051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:49:20+00:00 2026-05-15T03:49:20+00:00

How do I implement an image button in BlackBerry?

  • 0

How do I implement an image button in BlackBerry?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T03:49:21+00:00Added an answer on May 15, 2026 at 3:49 am

    here you go, complete code:

    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.component.ButtonField;
    
    /**
     * Button field with a bitmap as its label.
     */
    public class BitmapButtonField extends ButtonField {
            private Bitmap bitmap;
            private Bitmap bitmapHighlight;
            private boolean highlighted = false;
    
            /**
             * Instantiates a new bitmap button field.
             * 
             * @param bitmap the bitmap to use as a label
             */
            public BitmapButtonField(Bitmap bitmap, Bitmap bitmapHighlight) {
                this(bitmap, bitmapHighlight, ButtonField.CONSUME_CLICK|ButtonField.FIELD_HCENTER|ButtonField.FIELD_VCENTER);
            }
    
            public BitmapButtonField(Bitmap bitmap, Bitmap bitmapHighlight, long style) {
                super(style);
                this.bitmap = bitmap;
                this.bitmapHighlight = bitmapHighlight;
            }
    
            /* (non-Javadoc)
             * @see net.rim.device.api.ui.component.ButtonField#layout(int, int)
             */
            protected void layout(int width, int height) {
                    setExtent(getPreferredWidth(), getPreferredHeight());
            }
    
            /* (non-Javadoc)
             * @see net.rim.device.api.ui.component.ButtonField#getPreferredWidth()
             */
            public int getPreferredWidth() {
                    return bitmap.getWidth();
            }
    
            /* (non-Javadoc)
             * @see net.rim.device.api.ui.component.ButtonField#getPreferredHeight()
             */
            public int getPreferredHeight() {
                    return bitmap.getHeight();
            }
    
            /* (non-Javadoc)
             * @see net.rim.device.api.ui.component.ButtonField#paint(net.rim.device.api.ui.Graphics)
             */
            protected void paint(Graphics graphics) {
                    super.paint(graphics);
                    int width = bitmap.getWidth();
                    int height = bitmap.getHeight();
                    Bitmap b = bitmap;
                    if (highlighted)
                        b = bitmapHighlight;
                    graphics.drawBitmap(0, 0, width, height, b, 0, 0);
            }
    
            public void setHighlight(boolean highlight)
            {
                this.highlighted = highlight;           
            }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implement one application in which four image button and on image button
I am trying to implement image as checkbox. I have a list with 2
I am using jcrop to implement image cropping in my site. After clicking on
I have to implement an Image Gallery for the iPhone iOS. Pictures are loaded
How could I implement an image preview feature like Google image search result, when
I am trying to implement a image recognition program in C++ . I had
greetings, im trying to implement an image rollover on a collection of PictureBox (es)
i need to implement the email signature with image.As of now we only support
I am trying to implement an application which uses RIOT (Radical Image Optimization Tool)
How can one implement the fisheye lens effect illustrated in that image: One can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.