WindowListener « JFrame « Java Swing Q&A





1. How can a Swing WindowListener veto JFrame closing    stackoverflow.com

I have a frame, and want to prompt when the user closes it to save the document. But if they cancel, the frame shouldn't close.

frame.addWindowListener(new SaveOnCloseWindowListener(fileState));
...
public class SaveOnCloseWindowListener extends WindowAdapter {
 ...

2. Window operation notification in Java    stackoverflow.com

I want my Java program to know when a particular program has its window maximized or minimized or may be is running in exclusive full screen mode(most importantly when not). How ...

3. Override minimize of JFrame    stackoverflow.com

I'm making a program with a logger. The logger has its own JFrame. I'm trying to override the reaction from clicking on the minimize-button of that frame. I would like the frame to ...

4. How do i find if a window is opened on swing    stackoverflow.com

I have a problem with my application where the user will open more than one window at a time. And i have added dispose() method to call on closing the window. ...

5. Java - How to close a form from inside?    stackoverflow.com


I am creating a form in java.
When I want to close it - I go to the Jframe and set it to visible false.
Since the frame creates the java class of ...

6. JFrame question    stackoverflow.com

What code is called when a JFrame is minimized? Is it hooked up to a listener? I just want to know what happens internally when the frame is minimized. EDIT: Im actually looking ...

7. How to close a frame in Java without closing the cmd prompt?    stackoverflow.com

Here is the frame (i.e. java.awt.Frame) code. When I click the close button on the window it doesn't close and every time I have to close the the cmd prompt from ...

8. Detect mouse click anywhere on window    stackoverflow.com

I've written a JWindow that acts a bit like a fancy menu in my application, popping up when a button is pressed. However, I'd like it to disappear if the user ...

9. java - swing - windowlistener    stackoverflow.com

If I'm creating a class, and I will load an object of that class in my JFrame (the class is basically a panel with button and text objects, but that doesn't ...





10. Closing a Swing Frame, user vs system initiated close. How to tell the difference?    stackoverflow.com

I've looked for the answer to this problem, but can't seem to find it anywhere. I may just not know the right keywords. Any gentle prodding in the right direction would ...

11. How to trap the Window state?    stackoverflow.com

I'd a snipped and want to know how to trap it?

frame.addWindowStateListener(new WindowStateListener(){
    public void windowStateChanged(WindowEvent e) {
        System.out.println(e.getNewState());//I need to trap ...

12. adding a WindowListener to a JFrame    forums.oracle.com