Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 04-20-2004, 11:55 PM   #1 (permalink)
 
Newb Techie

Join Date: Apr 2004

Posts: 11

baloon

Default image in Java GUI

Do you know how to put an image in the GUI? I just want to put a small logo for something in a corner of the GUI window, that's all!

Thanks in advance!
baloon is offline  
Old 04-25-2004, 03:38 PM   #2 (permalink)
 
Junior Techie

Join Date: Oct 2003

Posts: 85

zoerb

Default

Image imageName;
imageName = getImage(getDocumentBase(),"image.jpg");
g.drawImage(snake,xlocation,ylocation,this);

where g is the graphics device painting your window

and also, this only works if the image is in the program's folder, otherwise replace getDocumentBase() with the full image path, such as getImage(c:\folder, "image.jpg")
__________________
Asus A7n8x-x
athlon 2800
radeon 9600 pro
512 mb 2700 mem
western digital 80gb special edition
zoerb is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On