?
Solved

Loading a gif using awt??

Posted on 2003-03-21
8
Medium Priority
?
139 Views
Last Modified: 2010-03-31
Hi everybody,

can anybody give me a shove in the right direction?
0
Comment
Question by:Unimatrix_001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 8182303
Image image = Toolkit.getDefaultToolkit().createImage("yourGif.gif");
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 8182323
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
 
LVL 3

Author Comment

by:Unimatrix_001
ID: 8182341
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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 18

Accepted Solution

by:
bobbit31 earned 120 total points
ID: 8182361
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
 
LVL 3

Author Comment

by:Unimatrix_001
ID: 8182397
ok thanks...I'll request a point split.
0
 

Expert Comment

by:modulo
ID: 8183069
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
 
LVL 3

Author Comment

by:Unimatrix_001
ID: 8183153
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 8183306
> Thank you Bobbit!

no prob ;)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will learn how to implement Singleton Design Pattern in Java.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month13 days, 19 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question