Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Java (http://www.programmingforums.org/forum17.html)
-   -   midlet-j2me (http://www.programmingforums.org/showthread.php?t=12136)

Nim_ Dec 8th, 2006 8:55 AM

midlet-j2me
 
I'm using Netbeans IDE 5.5 with mobility pack and I'm making a midlet application.

I have a main form with an "ok" button returning to itself.
I have added on form, an imageItem1 on which i haven't put any default image. ( image = none)
i have added an image item(image1)

As you can see, I'm trying to add the image1 on imageItem1 when the flag boolean is true and dissapear it if not.. It just doesn't work..no errors:

:

if (displayable == helloForm) {
            if (command == exitCommand) {
                          // Insert pre-action code here
                exitMIDlet();
                          // Insert post-action code here
          } else if (command == okCommand1) {
                        // Insert pre-action code here

                getDisplay().setCurrent(get_helloForm());
                      // Insert post-action code here 

                    if(flag == true){
                      imageItem1.setImage(image1);
                      flag = false;
                    }
                    else{
                      imageItem1.setImage(null);
                      flag = true;
                    }             
            }
        }

It doesnt work even without the "if" process.. leaving only the:
:

imageItem1.setImage(image1);

any solutions?

Nim_ Dec 9th, 2006 8:41 PM

ok, I finally manage to make it.. it was just because the code of the image1 hadn't have run.. so i had to run the method image1() before put the image in the imageItem1. ..


All times are GMT -5. The time now is 11:20 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC