views:

112

answers:

1

Hello, I'm doing this:

private Vector menuOptions;

void addOption(String imagefilename) {
    try {
        Image i = Image.createImage(imagefilename);
        menuOptions.addElement((Object)i);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

And I'm getting: java.lang.NullPointerException at GraphicMenu.addOption(GraphicMenu.java:31) //addElement line

Can I add a Inmutable images to a Vector Object?

A: 

Have you initialized the vector?

Vector menuOptions = new Vector();
kgiannakakis
jaja, buu, I think it's time for a break!thanks
Santiago