babytoy
asked on
loading an image
ive been having this problem for 2 days already.. ive been surfing the net and reading books but with no prevail i still dont know or any idea what to do with this problem.. what am i doing wrong? ive been having a NullPointerException pointing to here : setup.setImage(Toolkit.get DefaultToo lkit().get Image("mpi x/rmstudio .gif") ); setup is an instance of my JFrame with an attribute of Image so i could draw the image on my jframe.. this line -> setup.setImage(Toolkit.get DefaultToo lkit().get Image("mpi x/rmstudio .gif") ); is located on another class called Tools.. then calling setup.repaint()..i wanted to insert the image on the jframe by clicking on a jbutton ( which has the setup.setImage(Toolkit.get DefaultToo lkit().get Image("mpi x/rmstudio .gif") ); .. is the problem really pointing here?
Any help would be appreciated.
Any help would be appreciated.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
by using this i still get a NullPointerException but it is now pointing to the line where i added the myImageLabel to the contentpane of JFrame.
ASKER
oh i see. ill look on to that first. thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
A friend told me that i was passing an instance that doesn't exist. That's why its prompting a NullPointerException. what i need now is to load the images faster. Fortunately there's a suggestion above. =) Lastly, Thank you all for your kindness. =) i really appreciate it.
8-) Incidentally, the image doesn't need to be in a jar to load as i mentioned
:°)
ASKER