aspose file tools
The moose likes Swing / AWT / SWT and the fly likes image in glassPane Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "image in glassPane" Watch "image in glassPane" New topic
Author

image in glassPane

Agapios Hartzoulakis
Greenhorn

Joined: Oct 13, 2005
Posts: 17
Hi,
Here is my problem. I've made a glassPane extending JPanel which overrides a JFrame and blocks all the key/mouse events. What I want to do is to set an image to be displayed in the glassPane while it is visible. I've tried all the other components(JTextField, JLabel etc) and are been displayed just fine expept one. Guess what! The one that I want to use , an image! So my question is: Is something special with the image? How can I implement what I want?
Thanks a lot
Ko Wey
Ranch Hand

Joined: Sep 08, 2003
Posts: 67
I thougt I understood a few things about swing, but after reading

"...I've made a glassPane extending JPanel which overrides a JFrame..."

I am not so sure!
With impatience I wait for a reply of one of the ranch-hands!
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

How did you add the image? Using an ImageIcon and JLabel, or some other way?


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
Post code! This works for me. Notice that you may have to explicitly reset
your glasspane to be visible after you add it.


There is no emoticon for what I am feeling!
Agapios Hartzoulakis
Greenhorn

Joined: Oct 13, 2005
Posts: 17
Sorry if I wasn't quite clear.I didn't mean to make you forget what you already know!
Well, I'm using a class gor the glassPane that I found in another site and it works just fine for me except from the detail with the image.
The class is:

in the constructor of the main frame


I guess I have to change the paint method so that my image to be shown (the image is in the same folder as the rest of the .java files)
I hope to be more clear this time.
Thanks in advance
Agapios Hartzoulakis
Greenhorn

Joined: Oct 13, 2005
Posts: 17
At last I found my error by reading some other topics. Thanks anyway
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: image in glassPane
 
Similar Threads
JFrame, Image/Graphics and JInternalFrame
[Q] mechanism of GlassPane
Problem with tabbing behind glasspane
Urgent !! How to set the size of a glasspane
Loading JPG with JAI