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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:17:43+00:00 2026-06-04T08:17:43+00:00

How to display an image on a UiApplication? I have a code that displays

  • 0

How to display an image on a UiApplication?

I have a code that displays a button and when clicked it goes to a MainScreen, but I’d like to display an image below that button. I found a way to insert a zoomable image but not a static one.

Here’s my code so far:

public class HelloWorldDemo extends UiApplication {
    private MainScreen _screen;
    private ButtonField _nextScreen;

    public static void main(String[] args) {
         HelloWorldDemo instance = new HelloWorldDemo();
         instance.enterEventDispatcher();
    }
    public HelloWorldDemo() {
        EncodedImage myImg = EncodedImage.getEncodedImageResource("k.jpg");

        ZoomScreen zoomableImg = new ZoomScreen(myImg);


         _screen = new MainScreen();
         _nextScreen = new ButtonField("Go to Next Screen",ButtonField.FIELD_HCENTER | ButtonField.CONSUME_CLICK);
         _nextScreen.setChangeListener(new FieldChangeListener() {
               public void fieldChanged(Field field,int context) {
                  pushScreen(new NextScreen());
               }
          });
          _screen.setTitle(new LabelField("Hello World Demo",LabelField.USE_ALL_WIDTH));
          _screen.add(new RichTextField("Hello to the BlackBerry World!",Field.NON_FOCUSABLE));
          _screen.add(_nextScreen);
          pushScreen(_screen);
          pushScreen(zoomableImg);

   }

}
  • 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-06-04T08:17:44+00:00Added an answer on June 4, 2026 at 8:17 am
    //I'm confused about your question. But still I'm posting ans here hope it will help you.
    public final class ZoomScreenDemo extends UiApplication
    {
        public static void main(final String[] args)
        {
            UiApplication app = new ZoomScreenDemo();
            app.enterEventDispatcher();
        }
    
    
        public ZoomScreenDemo()
        {
            pushScreen(new ZoomScreenDemoScreen());
        }
    
    
        public final static class ZoomScreenDemoScreen extends MainScreen
        {    
            private EncodedImage _image;   
            private ButtonField _nextScreen;
    
            public ZoomScreenDemoScreen()
            {           
                setTitle("Zoom Screen Demo");          
    
                _nextScreen = new ButtonField("Go to next screen ",ButtonField.CONSUME_CLICK);
                _nextScreen.setChangeListener(new FieldChangeListener() {
    
                    public void fieldChanged(Field field, int context) {
                         UiApplication.getUiApplication().pushScreen(new DemoZoomScreen(_image));
                    }
                });
    
                add( _nextScreen );
                _image = EncodedImage.getEncodedImageResource("img/building.jpg");        
                BitmapField bitmapField = new BitmapField(_image.getBitmap(), FIELD_HCENTER | FOCUSABLE);
                add(bitmapField);            
            }       
        }    
    
    
    
        static class DemoZoomScreen extends ZoomScreen
        {    
            DemoZoomScreen(EncodedImage image)
            {
                super(image);
            }
    
            public void zoomedOutNearToFit()
            {            
                close();
            }    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Custom List to display image with it's name like below... public class
I am using this code to display image from URL, but it is not
I use this code to display image that locates outside the my java project,
I want to display the image like first image but my images are displaying
i want's to display image capture using device camera and for that i have
I need to display an image, which I've done without problems before, but today
how can i display a image on button which is presented on UINavigationController iphone
I may seem ignorant but I have not found much information about how to
I have 52 images that is coming from web URL.I want to display this
I want to display image in img control. Asp code: <asp:Image id=id src='<%# Eval(Item.SmallPicPath)

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.