using the java swing how can i put a background image to my application in a way that the image will cover the frame .
ps : I'm new to the java so maybe my question is a silly one but i will appreciate any help .
You declare im and frame inside the constructor ImageBackGround(), so they can't be accessed from anywhere else. If you want them available to all the methods of that class then declare them in the class but outside any one method. Read More
Two small suggestions... [ICODE]new ImageIcon("file name")[/ICODE] is certainly convenient, but it throws no Exceptions if it fails, thus leading to confusing errors later on when you try to use the image. It's a good idea to check the resulting Image, eg [ICODE]im.getWidth(null)>0[/ICODE] and issue a diagnostic if necessary If the … Read More
Edited by jackbauer24: n/a
Edited by JamesCherrill: n/a
Edited by zeroliken: n/a
Edited by jouj: n/a