2010-04-14 11 views
1

am new here. 나는 약간의 문제가있다. 다음 코드를 살펴보고 이미지가 표시되지 않기 때문에 잘못된 작업을하고 있는지 말해보십시오. 나는 그것을 정말로 작게 만들었다. 그래서 그것은 맞아야한다. 그러나 그 것은 나타내지 않고있다. 나는 다른 화면에 표시되는 이미지를 가지고 있지만이 메인 미들 렛은 그렇지 않습니다. 코드는 다음과 같습니다.이미지가 미들 렛에 표시되지 않습니다.

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) { 
    } 

미리 감사드립니다.

답변

1

귀하의 양식에 Form.append() 이미지를 잊어 버린 것처럼 보입니다.

+0

나는 너무 바보 같고 부끄럽다. 나는 그 일을 잊어 버렸다고 믿을 수 없다. 나는 그것을 계속 보았다. 고맙습니다. – irobotxxx

관련 문제