awt default toolkit  
Author Message
Michael G





PostPosted: 2005-6-22 22:07:00 Top

java-programmer, awt default 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 =----