How to load a image as a background to a Frame?

Hey,

Well i have a frame and inside it has internal frames,

now i want to set a image to the background to the main frame

how can i do this?

any help will be appriciated,

avdzm

(PS if there apperas to be 2 posts with one no msg,

sorry

I accidently pressed enter in subject.)

[330 byte] By [avdzma] at [2007-10-2 18:59:03]
# 1

here's the results of typing your subject into the 'Search Forums' (to the left)

http://onesearch.sun.com/search/onesearch/index.jsp?qt=How+to+load+a+image+as+a+background+to+a+Frame&subCat=siteforumid%3Ajava57&site=dev&dftab=siteforumid%3Ajava57&chooseCat=javaall&col=developer-forums

Michael_Dunna at 2007-7-13 20:37:34 > top of Java-index,Desktop,Core GUI APIs...
# 2

Try this

<code>

public void paintComponent(Graphics g){

try{

super.paintComponent(g);

ImageIO io = null;

Image image = ii.read(pic.jpg);

int width = this.getWidth();

int height = this.getHeight();

Graphics2D g2D = (Graphics2D)g;

g2D.drawImage(image,0,0,width,height,this);

}catch(Exception e){e.printStackTrace();}

}

</code>

In The main frame use this or something like it that meats your needs.

chad25a at 2007-7-13 20:37:34 > top of Java-index,Desktop,Core GUI APIs...