readImage?
publicvoid loadAndDisplay(String filename){
Image img = readImage(filename);
awtImage = img;
i j ust wanted to know what the filename is?
what does it do?
and how do i create it?
publicvoid loadAndDisplay(String filename){
Image img = readImage(filename);
awtImage = img;
i j ust wanted to know what the filename is?
what does it do?
and how do i create it?
Hi hemant_mistry,
I can not understand the question because it seems to simple to say the truth.
> know what the filename is?
The method you displayed to us (which seems to not be complete seems to take an argument of type String. The argument I think takes the path of the image. Then you have the method readImage which seems to be returning an object of type Image which is being stored in the 'img' object. Then it continues in some logic not being displayed.
> what does it do?
It determines what image from your drive should be loaded ... I guess!
> and how do i create it?
I simply can not understand this question. I do not know for what you are refering, and what you want to create.
extra...
When you write a question do give more information, the more information you give the more you increase the chances of getting an answer :)
also an Image can just be loaded by doing the following:
Image myImage = new ImageIcon(fileName).getImage();
So I do not see the reason why to create an extra method which does that, unless maybe that method takes care of other elements needed by the whole application, in which case I sugest pasting the code here to get more specific answers.
also for your help you can check the following URL:
http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/ImageIcon.html
regards,
sim085