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]

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
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.