CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Java and JSP (http://www.codingforums.com/forumdisplay.php?f=54)
-   -   Java coding problem (http://www.codingforums.com/showthread.php?t=14087)

JavaTest? 02-03-2003 08:25 PM

Java coding problem
 
Is there any way to set the background of an applet to an image file like a .bmp image?

Josh Campbell 02-03-2003 11:01 PM

.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);
}

JavaTest? 02-05-2003 06:50 PM

thanks


All times are GMT +1. The time now is 05:52 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.