• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Display image using getCodeBase() method

 
Akmal Zahdi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hiii every1...

I'm still study java by doing and understand the tutorial provided by this web site in CodeBarn. At the moment, I'm doing LoadAGif tuturial. Well in this tutorial, i detect 1 mistake there. It's declare the init method



I change it to



everything is OK

But suddenly, image is not display. There're no error. I think it cannot found path of image.

The init() method is like below



I think the error is the Bold One. Can anybody fix this problem to me.
I'm really appreciate it if u could help me in this problem. Any problem u just refer it on LoadAGif file in CodeBarn..
 
Manuel Moons
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A. Is the image located at the same location as the class files?
B. I do not see any code that paints the image? Do you paint it?
 
Akmal Zahdi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tq Manual Moons take regards for this question. Yes, I'm idiot, but just in JAVA only. .

For the first question, the answer is yes. I already located the image same as the class file.

For the second question, I think I paint it before the image is fully downloaded. Below is the full code.



I hope u and everybody else can help me to make appear. That's for now. Tq very much.
 
Akmal Zahdi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hahaahahahah

That's why I like do pogramming eventhough I'm not very good. Why I like programming. This is because It give me challenge and satisfied. Challenge because It's very difficult and many my friend say they don't want to be good in JAVA. Satisfied because I'm very happy when I can solve something I dunno.

Well, my problem about why the image is not appear already solve a minute ago. It's just very2x small error. It's extension of type file. I change it from YM02.jpeg into YM02.jpg.

It's so simple. Anyway thanx Manuel Moon cause ask me a question esp the 1st question. Tq very Much.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic