[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
rohith yenumula wrote:Hi. I want to add an image to a frame. I want to know how one creates an image object and displays it in a frame.
Thanks in advance.
java amateur
label.setIcon(new ImageIcon("myImage"));
rohith yenumula wrote:Thanks for the example.
label.setIcon(new ImageIcon("myImage"));
I have a doubt regarding the ImageIcon constructor. I tried passing the relative and absolute address of a image but there was no image displayed.
java amateur
java amateur
miguel lisboa wrote:java is case sensitive
so, JPEG is diferent from jpeg, i guess
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
rohith yenumula wrote:Hi Miguel. I have tried doing it as you told but it didn't work.
There are no compile-time or run-time errors but two .class files(DisplayImage and DisplayImage$1) were created when I ran the program. Do you have any idea why is it so?
java amateur
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Would anybody like some fudge? I made it an hour ago. And it goes well with a tiny ad ...
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|