Mouse move question in swings.

I've 2 labels, of which one is set to visible(false). When the mouse is moved over Label1, Label2 becomes visible. When the mouse is moved away Label 2 should become invisible again. I'm able to make Label2 visible when the mouse is moved over Label1 (thats simple ;) ). How do i make it invisible again?

[313 byte] By [-...icedT...-a] at [2007-11-27 5:44:47]
# 1
post your code so that we can poke around and tweak it ;)And dont forget to use the code tags
ArcherKinga at 2007-7-12 15:25:50 > top of Java-index,Java Essentials,New To Java...
# 2
I assume you are using a MouseListener, then try implementing one of the other methods available to you.
floundera at 2007-7-12 15:25:50 > top of Java-index,Java Essentials,New To Java...
# 3

ok so no code :(

I going to guess you are using the MouseListener interface.

use the mouseExited(MouseEvent me) method to set it to invisible again

void mouseExited(MouseEvent me)

{

if(mouse isn't in the area where label 2 is supposed to be)

label2.setVisible(false);

}

ArcherKinga at 2007-7-12 15:25:50 > top of Java-index,Java Essentials,New To Java...
# 4
The mouse exited function works fine... thanks King,flounder... i guess i should explore more before i put the question in the forum next time... :DMessage was edited by: -...icedT...-
-...icedT...-a at 2007-7-12 15:25:50 > top of Java-index,Java Essentials,New To Java...
# 5
so do we get duke stars?
ArcherKinga at 2007-7-12 15:25:50 > top of Java-index,Java Essentials,New To Java...
# 6
There u go... 5 each for both of u... i guess i've a big heart ;)
-...icedT...-a at 2007-7-12 15:25:50 > top of Java-index,Java Essentials,New To Java...
# 7
gee thanksVery kind of ya.
ArcherKinga at 2007-7-12 15:25:50 > top of Java-index,Java Essentials,New To Java...