How to close a Frame via MouseClick?
Hi there!
I made a little Program which uses a Frame with Labels in it to show some Text.
The Problem i have is how to close this Frame just by clicking on it with my Mouse.
I allready implements MouseListener and implments all the methods it needs, but it wont close if i click in it.
Thanks for your help...
Trollpower
Re: How to close a Frame via MouseClick?
Do you mean that you want to close the frame whereever you click on it?
Kannan
Re: How to close a Frame via MouseClick?
yes. But for the beginning it is ok if i have to click on a single spot in the Frame (Title, Screen).
Greetings
Trollpower
Re: How to close a Frame via MouseClick?
i thought that i can add such a Listener simply by "putting" it around the Object itself. For example:
mouseListener(){
Frame myFrame = new Frame();}
something in this way, you know?
Trollpower
Re: How to close a Frame via MouseClick?
frame.hide();
frame.dispose();
System.exit( 0 ) // If you like to terminate the application.