Helping with class Image
I need to appear images in a menu beside a text but it doesn't appearcompletlywhat appear is only a part of it my editor is netbeans and there is the code of my test
package TravelList;
import java.io.*;
import javax.microedition.lcdui.game.Sprite;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
/**
* Program shows a simple MIDlet that could be part of a travel reservation application. The user chooses what type of reservation to make.
* @author Wallaa Elmasry
* @version 1.0
*/
public class TravelList extends MIDlet implements CommandListener
{
//Declare list we used
private List mList;
private Command mExitCommand,mNextCommand;
public TravelList()
{
String[] stringElements={"Airplane","Car","Hotel"};
Image[] imageElements={LoadImage("/TravelList/mymac.png"),LoadImage("/TravelList/netscape.png"),LoadImage("/TravelList/msn.png")};
mList=new List("Reservation Type",List.IMPLICIT,stringElements,imageElements);
mNextCommand=new Command("Next",Command.SCREEN,0);
mExitCommand=new Command("Exit",Command.EXIT,0);
mList.addCommand(mNextCommand);
mList.addCommand(mExitCommand);
mList.setCommandListener(this);
}
public void startApp()
{
Display.getDisplay(this).setCurrent(mList);
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
public void commandAction(Command c, Displayable s)
{
if(c==mNextCommand||c==mList.SELECT_COMMAND)
{
//To get index of selected element
int index=mList.getSelectedIndex();
Alert alert=new Alert("Your Selection","you choose"+mList.getString(index),null,AlertType.INFO);
Display.getDisplay(this).setCurrent(alert,mList);
}else if(c==mExitCommand)
{
notifyDestroyed();
}
}
//This method is used in creating images used in the list
private Image LoadImage(String name)
{
Image image=null;
try
{
image=Image.createImage(name) ;
}catch(IOException ioe)
{
System.out.println(ioe);
}
return image;
}
}
olso i want to know what is the best dimensions for an image to be placed

