Search the web
Sign In
New User? Sign Up
uispec4j
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Click here for the latest updates on Groups Message search

Messages

  Messages Help
Advanced
closing window   Topic List   < Prev Topic  |  Next Topic >
Reply < Prev Message  | 
Hi,

In my application I have a window with no functional button to close it,
I'm relying on the closing button provided by the window manager. When the
user closes the window I want to display a (bit annoying) confirmation
JOptionPane.

In UISpec4J, the method to close a window when no functional button is
"dispose()" (which call the dispose() method on the actual window). My
problem is that I'm displaying the message window on WindowClosing event
which is not generated when calling dispose().

My solution is to generate a WindowClosing event myself like this:

private void closeWindow(final org.uispec4j.Window window) {
final Container container = window.getAwtComponent();
final WindowEvent event = new WindowEvent((java.awt.Window) container,
WindowEvent.WINDOW_CLOSING);
for (final WindowListener listener :
container.getListeners(WindowListener.class)) {
listener.windowClosing(event);
}
}

I'm wondering if that kind of function should be added in uispec4j
(org.uispec4j.Window.close() for instance). What do you think of it?
Cheers,

Laurent.




Mon Jul 13, 2009 8:51 am

laurent+uispec4j@...
Send Email Send Email

< Prev Message  | 
Expand Messages Author Sort by Date

Hi, In my application I have a window with no functional button to close it, I'm relying on the closing button provided by the window manager. When the user...
Laurent
laurent+uispec4j@...
Send Email
Jul 14, 2009
8:24 am

Hi Laurent, Thanks a lot, this is a very interesting suggestion. There is indeed a call for improvement here. However, I don't feel good about adding a 'close'...
Pascal PRATMARTY
pratmartyp
Offline Send Email
Jul 14, 2009
11:03 am
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help