• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Images don't painting

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!
This is my first post, and I need your help!
I'm trying to display five images, but I can't. I don't have any error message, any warning!
I have two classes:

Class 1:



Class 2:


I see the background, and the Strings, but no images :-(

Any help will be great!

Thank you in advance!

Daniel Lima
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
# public void loadImages() {
# bgImage = loadImage("/images/background.jpg");
# opaqueImage = loadImage("/images/opaque.png");
# transparentImage = loadImage("/images/transparent.png");
# translucentImage = loadImage("/images/translucent.png");
# antiAliasedImage = loadImage("/images/antialiased.png");
# imagesLoaded = true;
# // signal to AWT to repaint this window
# repaint();
# }

Try using now. Hope this will help you
 
Daniel Lima
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Vijay Kakade !
Tnx for your reply!

This don't work. I've tryed...

I don't know what's happening.... I looked the code thousands of times!

Please try test this code in your computer...

Tnx in advance!
 
Sharad Jadhav
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are all images in classpath? Put that in classpath It should display the images.
 
Daniel Lima
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Vijay Kakade, tnx!

I'm newbe on J2SE...and I'm using eclipse ide.... how can I put this images in classpath?
 
Daniel Lima
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Add information:

I've edited the .classpath file, no success.
I've edited the run configurations, no succes.
 
Daniel Lima
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!
More information!

if i do this:



It works!
But I think that I can't put the absolute path im my aplication...
 
Daniel Lima
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Resolved with:

 
Anything worth doing well is worth doing poorly first. Just look at this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic