Forums Register Login

Images in JFrame look like they are covered up

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
If you posted some code, it would help determine why it is not working.
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
"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!
+Pie Number of slices to send: Send
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).
If you try to please everybody, your progress is limited by the noisiest fool. And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 871 times.
Similar Threads
variable amount of images, layering images and transparency
including files in .jar file using eclipse IDE
How to run a java jar file from Eclipse?
Multiple JFrames but no desktop no JDesktopPane
Come back little moosey, come back!!!
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 14:46:53.