awt's toolkit



The following will not show the image nor will it throw any exceptions. Not
throwing exceptions doesn't surprise me because the documentation show that
it won't. That is a little surprising in itself. I am not using Swing
components.

public void paint(Graphics g){

String fileName = "dir/a.gif";
Toolkit toolkit = Toolkit.getDefaultToolkit();
Image img = toolkit.getImage(fileName);

// an awt panel's Graphics context doesnot show the image
g.drawImage(img, 0,0, null);

//this works fine
g.drawString("aString",50,50);

}


thanks, mike





----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
.



Relevant Pages

  • Re: awts toolkit
    ... > The following will not show the image nor will it throw any exceptions. ... > Not throwing exceptions doesn't surprise me because the documentation ... this advice isn't included in the documentation for Toolkit.getImage. ... You want paint to execute quickly. ...
    (comp.lang.java)
  • awt default toolkit
    ... The following will not show the image nor will it throw any exceptions. ... throwing exceptions doesn't surprise me because the documentation show that ... Toolkit toolkit = Toolkit.getDefaultToolkit; ...
    (comp.lang.java)
  • awts toolkit
    ... The following will not show the image nor will it throw any exceptions. ... throwing exceptions doesn't surprise me because the documentation show that ... Toolkit toolkit = Toolkit.getDefaultToolkit; ...
    (comp.lang.java)
  • awt default toolkit
    ... The following will not show the image nor will it throw any exceptions. ... throwing exceptions doesn't surprise me because the documentation show that ... Toolkit toolkit = Toolkit.getDefaultToolkit; ...
    (comp.lang.java)
  • awt default toolkit
    ... The following will not show the image nor will it throw any exceptions. ... throwing exceptions doesn't surprise me because the documentation show that ... Toolkit toolkit = Toolkit.getDefaultToolkit; ...
    (comp.lang.java)