Jump to content

  • Log In with Google      Sign In   
  • Create Account


Java images?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 JinixVomitorium   Members   -  Reputation: 151

Like
0Likes
Like

Posted 05 January 2013 - 12:49 AM

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......


Sponsor:

#2 Sean T. McBeth   Crossbones+   -  Reputation: 1384

Like
2Likes
Like

Posted 05 January 2013 - 01:13 PM

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.]





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS