1

I found this post on the site:

Blackberry Clickable BitmapField

explaining a class where you can draw a clickable bitmap. This is exactly what I want to do but the issue for me is that I'm quite new to Java and I don't know how to properly call this statement. What are the commands to create this bitmap? So far all I have is:

CustomMenuButtonField buttonInstance = new CustomMenuButtonField("img1.png", "img2.png");

aside from that I don't know how to make the drawing appear. If I try:

buttonInstance.paint(graphics);

I need to declare graphics which I am not sure how to do. I've checked the API but its still a bit confusing to me. Also where should these call statements be used? In the userInterface constructor?

Community
  • 1
  • 1
user1152440
  • 895
  • 2
  • 13
  • 25

1 Answers1

1

Once you create your custom button field, you just need to add it to your screen:

add(buttonInstance);

It will then be displayed by the framework automatically. For more info, see the Getting Started Guide for the SDK version you are using in the Development Guides.

Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
  • Thank you this helped a lot and the image is appearing. A weird thing that is happening is that the second image remains on the display after I click it, even after I exit and enter the app again. If I want to have the image change back to the original once one opens and exits or resets how would I do this? – user1152440 Jan 26 '12 at 19:59
  • @user1152440 - That would depend on your code. I suggest that you ask a new question and post more info about what you're trying to do and what the problem is. – Ted Hopp Jan 26 '12 at 20:14