Java images?

Started by
0 comments, last by capn_midnight 11 years, 3 months ago

What is wrong with this?

public void paint(Graphics g) {

guiLayout = getImage(getCodeBase(), "gui.png");

//Object .paints
g.drawImage(guiLayout, 500, 300, this);

}

As far as I can tell the code is correct, there are no errors and the applet runs, but it doesnt display the image...

I've tried several methods to display the image, its weird that none are working now when they worked yesterday with a different image. -____-

add me on skype, i need some new associates for coding.

skype: daniel.lamonds

c++, Visual basic, fortran, html/5, css, php,java script, sql, others......

Advertisement

drawImage returns immediately, whether the image is loaded or not. Check the return value of drawImage. If it's false, then the image has not yet loaded. Since you're reloading the image every time you paint, I suspect this is probably the case.

This may have more information for you

[Formerly "capn_midnight". See some of my projects. Find me on twitter tumblr G+ Github.]

This topic is closed to new replies.

Advertisement