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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:19:00+00:00 2026-05-14T07:19:00+00:00

am new here. i have a slight problem; PLease look at the following code

  • 0

am new here. i have a slight problem; PLease look at the following code and tell me if am doing something wrong because the image is not displaying. i have made it really small so it should fit but its not displaying. i have images displaying in other screens but this main midlet would not. Here is the code:

import java.io.IOException;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

/**
 * @author jay
 */

public class WShop extends MIDlet implements CommandListener {

    /* Declare display variables*/
    private Form mainForm;
    private Display display;
    private Command OK,Exit,wView, mView, myView;

    /* */
    Categories categories = new Categories(this);
    Image image;


    public WShop() {

            /* initialize Screen and Command buttons that will
               be used when the application starts in the class constructor*/


            mainForm = new Form("Wind Shopper");

            OK = new Command("OK", Command.OK, 2);
            Exit = new Command("Exit", Command.EXIT, 0);
            wview= new Command("wview", Command.OK, 0);
            mview= new Command("mview", Command.OK, 0);

              try {
            /* retrieving the main image of the application*/
              image = Image.createImage("/main.png");
        } catch (IOException ex) {
            ex.printStackTrace();
        }



            mainForm.addCommand(OK);
            mainForm.addCommand(Exit);
            mainForm.addCommand(wView);
            mainForm.addCommand(mView);
            mainForm.setCommandListener(this);


    }

    public void startApp() {

         /* checks to see if the display is currently empty
          and then sets it to the current screen */

        if (display == null) {
            display = Display.getDisplay(this);
        }
            display.setCurrent(mainForm);
    }

 /* paused state of the application*/
    public void pauseApp() {
    }

   /* Destroy Midlet state*/
    public void destroyApp(boolean unconditional) {
    }

Thanks in advance.

  • 1 1 Answer
  • 3 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-14T07:19:00+00:00Added an answer on May 14, 2026 at 7:19 am

    Looks to me like you forgot to Form.append() your Image to your form.

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

Sidebar

Related Questions

I have a slight problem with code here. I'm fairly new to it so
I'm new here and have a problem. I am having to pick up C#
I'm new here and I have a problem with the jQuery's function - animate
I'm quite new here. I have a problem with the new iOS 5.1 slide-in
I'm new here and kinda new to java. I've encountered a problem. I have
I have a slight problem here I try to solve. As I start to
I'm relatively new at PHP and came across a slight problem. I have a
hey, i'm new to android and i have a slight problem. i'm trying to
I'm new here,and i have some problem about FOAF. I use jena create a
Got a slight problem here. I have a form for a guestbook and each

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.