This week's book giveaway is in the Open Source Projects forum.
We're giving away four copies of Spark in Action and have Jean-Georges Perrin on-line!
See this thread for details.
Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Display image using getCodeBase() method

 
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..
 
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.
 
Would anybody like some fudge? I made it an hour ago. And it goes well with a tiny ad ...
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic