File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Images don't painting

 
Daniel Lima
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Sharad Jadhav
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are all images in classpath? Put that in classpath It should display the images.
 
Daniel Lima
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Resolved with:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic