There are lots of ways of doing this, and no doubt everyone will disagree on which the best is. But I think the real problem is that you’re trying to run before you can walk. Work through the Java tutorial on event listeners* and then come back to your code and see whether you can get it working.
Make sure to read through everything before you try to help!
I agree with pjt - Swing is pretty complicated and shouldn’t be bothered with until you’ve mastered the basics of Java using the console. You definitely don’t seem to understand inheritance yet, so maybe go back and try to learn that first. You’ll be happy you did.
hum, thank you, that’s true I choosed facility =)