Images in AWT

Suppose i have an image in a Panel. On clicking the Image some event occurs . How can I make the Image appear clickable to the User like say projected out or any others.   meaning if the user sees the screen he should feel that the image is clickable.
I am using AWT only.
--------------------------------------------------------------------------------
paramu83Asked:
Who is Participating?
 
colr__Connect With a Mentor Commented:
Or even better, a blue border similar to those hyperlinsk you see in your browser, with a rollover effet that changes the colour.

colr__
0
 
riaancorneliusCommented:
Maybe put a raised etchedBorder on the Panel. That should make it look more like a button?
0
 
hoomanvConnect With a Mentor Commented:
change the mouse cursor to hand
http://javaalmanac.com/egs/java.awt/SetCursor.html
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
paramu83Author Commented:
I think etchedBorder is provided by swing . I am not using swing , just plain AWT .

Correct me if I am wrong.
0
 
hoomanvCommented:
you are correct
0
 
colr__Commented:
You could use a JEditorPane, with the contents being html with the image defiend as a link:

http://java.sun.com/docs/books/tutorial/uiswing/components/editorpane.html
0
 
hoomanvCommented:
the asker asserted no swing solution
paramu83, why do you not set the mouse cursor to hand ? like when you hover an html link
0
 
colr__Commented:
Sorry, I was working on an old version of this page. ;-(
0
 
mukundha_expertConnect With a Mentor Commented:
One thing is you can give a border to that image,

put the image in the panel, set the background colour to blue or black,

in the paint method,
give  (Graphics) g.drawImage ( image, 2,2,width,height,this ) ;

you will get a border on the left and the top,

to get the border on the othersides, add component listener to this panel,

implement the componentResized() method,
in that  get the size of the panel and set the size of the image sightly less than the panel size.

0
 
riaancorneliusCommented:
fine by me :)
0
 
colr__Commented:
Me too ;-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.