Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
I've got a calculator type applet that pops up in a new Frame. It resizes, it deiconifies, it maximizes it minimizes, but it doesn't close when you click the close button in the upper right corner. I thought Frames had that built-in. Any help would be appreciated. BTW, this is not a JFrame. It's just an instance of AWT Frame. ------------------
Unfortunatly, you have to write the code to close the window yourself(sort of). I believe that it generates an event when you click on the close button, but you then have to capture it and destroy the window. Not exactly sure how, but one way would be to setVisible(false) and then set the frame equal to null. There may be a better way or a method written already, but I don't know what it is.
Hi, When working with Frames you need to add a window event handler to handle all the different stuff (7 different event types): windowActivated (show) windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, and windowOpened. Lucky for us, AWT offers us a class that has stubs for all 7 types: WindowAdapter. To use it with your frame:
This will remove your window when the 'X' system button is hit on the window frame. Enjoy, Manfred.
Hi Jeff, I am not understanding your layout. According to what I read you are starting up a frame that has the calculator in it. If that is the case then you need to add the windowListener to the frame and not calculator... Manfred.
My Frame is called calculator Frame calculator = new Frame("State Alcohol Tax Calculator"); calculator.addWindowListener( new WindowAdapter() { public void windowClosing( WindowEvent we ) { // Call Frame supplied method to close window! dispose(); } }); I can't figure it. I've got all the appropriate imports too. ------------------
Whoever got anywhere by being normal? Just ask this exceptional tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth