This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Images in JFrame look like they are covered up  RSS feed

 
starrman777
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JFrame that contains a couple of images. The problem is that the images appear as though they have been covered up.

Here is a cropped screenshot of the JFrame with 2 images. One of the images is the JFrame IconImage (in the blue bar at the top) and the other image is simply the company logo. The company logo is placed on top of a green background. You can see in the screenshot that where the logo is supposed to appear the green is a shade lighter.



This same JFrame and images appear perfectly when I run it inside of Eclipse but when I run it from the command line all the images appear to be covered up... could this be a painting/repainting issue.

I am a Java programmer of many years but haven't done Swing (Java/UI) programming in forever so I have a feeling that this is a basic problem and was hoping that someone would immediately know what I am probably doing wrong.

Thank You.
 
Brandon Broschinsky
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you posted some code, it would help determine why it is not working.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
most (well, a lot, anyway) painting problems in swing happen when you throw
an AWT component into the brew. e.g. Label instead of JLabel.

as already mentioned, posting the code will reveal all.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"starrman777" -

Welcome to the JavaRanch! We don't have many rules around the ranch, but we do have a policy on displayed names... Please adjust your displayed name to meet the JavaRanch Naming Policy. User names cannot be obviously fake and must consist of a first name and a last name.

You can change your user name here.

Thanks! and welcome to the JavaRanch!
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In addition to the request for code - What kind of images are you using? The posted pictures look like the images may have been corrupted in some way (I've seen the same effect in corrupted images anyway...) but I don't know how that would be the case if your program runs fine in Eclipse and runs this way from the command line (unless the same image files aren't being used).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!