Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-03-2003, 08:25 PM   PM User | #1
JavaTest?
New Coder

 
Join Date: Jan 2003
Location: USA
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
JavaTest? is an unknown quantity at this point
Java coding problem

Is there any way to set the background of an applet to an image file like a .bmp image?
JavaTest? is offline   Reply With Quote
Old 02-03-2003, 11:01 PM   PM User | #2
Josh Campbell
New Coder

 
Join Date: Jun 2002
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Josh Campbell is an unknown quantity at this point
.bmp bitmaps should not be used in Java. JPEG and GIF are the standards. You could simply draw the image in the paint method of your applet or another component.

public void paint(Graphics g)
{
super.paint(g);
Image im = getImage(getDocumentBase(), "myfile.gif");
g.drawImage(im, 0, 0, getSize().width, getSize().height, this);
}

Last edited by Josh Campbell; 02-03-2003 at 11:03 PM..
Josh Campbell is offline   Reply With Quote
Old 02-05-2003, 06:50 PM   PM User | #3
JavaTest?
New Coder

 
Join Date: Jan 2003
Location: USA
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
JavaTest? is an unknown quantity at this point
thanks
JavaTest? is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 05:34 AM.


Advertisement
Log in to turn off these ads.