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 7512643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:55:42+00:00 2026-05-29T23:55:42+00:00

I made a custom ButtonField class where I have an image as a button.

  • 0

I made a custom ButtonField class where I have an image as a button. However, I would like to be able to select this image and to know it is selected, either by partially highlighting it or putting a square around it, whatever. I have a BitmapField in my UI that highlights itself in blue when I select it, but my other images that use ImageButtonField, do not have the blue highlight. I do not want the bitmap to disappear completely when selected.

here is the code :

package mypackage;

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.system.Characters;
import net.rim.device.api.ui.component.BitmapField;

    public class ImageButtonField extends BitmapField{

    public ImageButtonField(Bitmap image) {
        super(image);
    }

    public boolean isFocusable() {
        return true;
    }

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

    protected boolean trackwheelClick(int status, int time) {
        fieldChangeNotify(0);
        return true;
    }

    protected boolean keyChar(char character, int status, int time) {
        if(Characters.ENTER == character || Characters.SPACE == character) {
            fieldChangeNotify(0);
            return true;
        }
        return super.keyChar(character, status, time);
    }
}

Any help modifying this class so it works would help immensely. I have had no success trying to make this work!

  • 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-29T23:55:44+00:00Added an answer on May 29, 2026 at 11:55 pm

    To remove default styling attributes you can add following methods:

    protected void applyTheme(Graphics arg0, boolean arg1) {
    }
    
    protected void drawFocus(Graphics graphics, boolean on) {
    }
    

    You can override paint method and do paint whatever you want by checking focus status, e.g. following code will paint a red transparent layer over the bitmap image.

    protected void paint(Graphics graphics) {
        super.paint(graphics);
        if (isFocus()) {
            graphics.setGlobalAlpha(128);
            graphics.setColor(0xFF0000);
            graphics.fillRect(0, 0, getWidth(), getHeight());
        }
    }
    

    Actually I didn’t understand your question well :).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

have a custom made slider which I would like to stop on hover. I've
I made a custom class. This is the h file @interface Player : NSObject
I have made a custom Attribute here named AAtribute, and for instance a class
I made a custom button by inheriting the Button class. When I double click
I made a custom UITableView subclass and implemented this: - (void)scrollViewDidScroll:(UIScrollView *)scrollView { //
I made a custom handler that derives from MvcHandler. I have my routes using
I have made a custom UserControl i Vb.net (windows application). How can I add
I made a custom UIView class and trying to set up in it an
I made a custom class that extends ProgressBar for some extra functionality. It's all
I have made custom .xml layout for ListView. Now it looks: But it isn't

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.