Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 141
  • Last Modified:

Loading a gif using awt??

Hi everybody,

can anybody give me a shove in the right direction?
0
Unimatrix_001
Asked:
Unimatrix_001
1 Solution
 
CEHJCommented:
Image image = Toolkit.getDefaultToolkit().createImage("yourGif.gif");
0
 
bobbit31Commented:
in an applet: Image image1 = getImage(<Url (ie. getCodeBase())>, "pic1.gif");

in an application: Image image1 = Toolkit.getDefaultToolkit().getImage(<URL>) OR Toolkit.getDefaultToolkit().getImage(<path>)

then you could put something like this in your paint method:
g.drawImage(image1, 0, 0, null); which will draw your image at 0,0 coordinate
0
 
Unimatrix_001Author Commented:
ooph! Looks like I'm splitting points here! :D....does both of those methods sorta like count in it being loaded into a frame?

sorta like, frame.add(image);

can I do that?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
bobbit31Commented:
no.

you have to put it in your paint method for your frame:

public void paint(Graphics g) {
   g.drawImage(image1, 0, 0, null); which will draw your image at 0,0 coordinate  
}
0
 
Unimatrix_001Author Commented:
ok thanks...I'll request a point split.
0
 
moduloCommented:
Dear Unimatrix_001

I've refunded 20 points to enable you to accept the comment for one expert and to post a
"Points for <expertname>" Q for the other expert in the same topic area.

Please:
1) Post the link to the original Q in the "Points for <expertname>" and
2) Add in the original Q a comment with the link to the "Points for <expertname>", thus the email notif will warn the expert.

modulo

Community Support Moderator
Experts Exchange
0
 
Unimatrix_001Author Commented:
0
 
bobbit31Commented:
> Thank you Bobbit!

no prob ;)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now